diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/ApiManagementClient.cs b/swaggerci/apimanagement.DefaultTag/generated/api/ApiManagementClient.cs new file mode 100644 index 000000000000..006402efedfd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/ApiManagementClient.cs @@ -0,0 +1,119607 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Low-level API implementation for the ApiManagementClient service. + /// ApiManagement Client + /// + public partial class ApiManagementClient + { + + /// Status of all policies of API Management services. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AllPoliciesListByService(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/allPolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AllPoliciesListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Status of all policies of API Management services. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AllPoliciesListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/allPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/allPolicies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/allPolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AllPoliciesListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AllPoliciesListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AllPoliciesCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AllPoliciesListByService_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Creates new or updates existing specified API of the API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameter body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Creates new or updates existing specified API of the API Management service instance. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameter body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameter body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified API of the API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Delete all revisions of the Api. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDelete(string resourceGroupName, string serviceName, string apiId, bool? deleteRevisions, string ifMatch, string subscriptionId, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + (null == deleteRevisions ? global::System.String.Empty : "deleteRevisions=" + global::System.Uri.EscapeDataString(deleteRevisions.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified API of the API Management service instance. + /// + /// Delete all revisions of the Api. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDeleteViaIdentity(global::System.String viaIdentity, bool? deleteRevisions, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "?" + + (null == deleteRevisions ? global::System.String.Empty : "deleteRevisions=" + global::System.Uri.EscapeDataString(deleteRevisions.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Delete all revisions of the Api. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDelete_Validate(string resourceGroupName, string serviceName, string apiId, bool? deleteRevisions, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a new Diagnostic for an API or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string diagnosticId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/diagnostics/" + + global::System.Uri.EscapeDataString(diagnosticId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new Diagnostic for an API or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/diagnostics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var diagnosticId = _match.Groups["diagnosticId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/diagnostics/" + + diagnosticId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string diagnosticId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(diagnosticId),diagnosticId); + await eventListener.AssertMinimumLength(nameof(diagnosticId),diagnosticId,1); + await eventListener.AssertMaximumLength(nameof(diagnosticId),diagnosticId,80); + await eventListener.AssertRegEx(nameof(diagnosticId),diagnosticId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified Diagnostic from an API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticDelete(string resourceGroupName, string serviceName, string apiId, string diagnosticId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/diagnostics/" + + global::System.Uri.EscapeDataString(diagnosticId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified Diagnostic from an API. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/diagnostics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var diagnosticId = _match.Groups["diagnosticId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/diagnostics/" + + diagnosticId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticDelete_Validate(string resourceGroupName, string serviceName, string apiId, string diagnosticId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(diagnosticId),diagnosticId); + await eventListener.AssertMinimumLength(nameof(diagnosticId),diagnosticId,1); + await eventListener.AssertMaximumLength(nameof(diagnosticId),diagnosticId,80); + await eventListener.AssertRegEx(nameof(diagnosticId),diagnosticId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Diagnostic for an API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticGet(string resourceGroupName, string serviceName, string apiId, string diagnosticId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/diagnostics/" + + global::System.Uri.EscapeDataString(diagnosticId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticGetEntityTag(string resourceGroupName, string serviceName, string apiId, string diagnosticId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/diagnostics/" + + global::System.Uri.EscapeDataString(diagnosticId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/diagnostics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var diagnosticId = _match.Groups["diagnosticId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/diagnostics/" + + diagnosticId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string diagnosticId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(diagnosticId),diagnosticId); + await eventListener.AssertMinimumLength(nameof(diagnosticId),diagnosticId,1); + await eventListener.AssertMaximumLength(nameof(diagnosticId),diagnosticId,80); + await eventListener.AssertRegEx(nameof(diagnosticId),diagnosticId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Diagnostic for an API specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/diagnostics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var diagnosticId = _match.Groups["diagnosticId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/diagnostics/" + + diagnosticId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticGet_Validate(string resourceGroupName, string serviceName, string apiId, string diagnosticId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(diagnosticId),diagnosticId); + await eventListener.AssertMinimumLength(nameof(diagnosticId),diagnosticId,1); + await eventListener.AssertMaximumLength(nameof(diagnosticId),diagnosticId,80); + await eventListener.AssertRegEx(nameof(diagnosticId),diagnosticId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all diagnostics of an API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticListByService(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/diagnostics" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all diagnostics of an API. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/diagnostics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/diagnostics" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticListByService_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the Diagnostic for an API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Diagnostic Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticUpdate(string resourceGroupName, string serviceName, string apiId, string diagnosticId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/diagnostics/" + + global::System.Uri.EscapeDataString(diagnosticId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the Diagnostic for an API specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Diagnostic Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiDiagnosticUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/diagnostics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var diagnosticId = _match.Groups["diagnosticId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/diagnostics/" + + diagnosticId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiDiagnosticUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Diagnostic Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiDiagnosticUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string diagnosticId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(diagnosticId),diagnosticId); + await eventListener.AssertMinimumLength(nameof(diagnosticId),diagnosticId,1); + await eventListener.AssertMaximumLength(nameof(diagnosticId),diagnosticId,80); + await eventListener.AssertRegEx(nameof(diagnosticId),diagnosticId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid + /// for 5 minutes. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. New + /// formats can be added in the future. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiExportGet(string resourceGroupName, string serviceName, string apiId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var export = @"true"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "format=" + global::System.Uri.EscapeDataString(format) + + "&" + + "export=" + global::System.Uri.EscapeDataString(export) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiExportGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid + /// for 5 minutes. + /// + /// + /// Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. New + /// formats can be added in the future. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiExportGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var export = @"true"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "?" + + "format=" + global::System.Uri.EscapeDataString(format) + + "&" + + "export=" + global::System.Uri.EscapeDataString(export) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiExportGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiExportGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiExportResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. New + /// formats can be added in the future. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiExportGet_Validate(string resourceGroupName, string serviceName, string apiId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"swagger-link", @"wsdl-link", @"wadl-link", @"openapi-link", @"openapi+json-link"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiGet(string resourceGroupName, string serviceName, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiGetEntityTag(string resourceGroupName, string serviceName, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the API specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the API specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiGet_Validate(string resourceGroupName, string serviceName, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a new Attachment for the Issue in an API or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Attachment identifier within an Issue. Must be unique in the current Issue. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueAttachmentCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string issueId, string attachmentId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "/attachments/" + + global::System.Uri.EscapeDataString(attachmentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueAttachmentCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new Attachment for the Issue in an API or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueAttachmentCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)/attachments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var attachmentId = _match.Groups["attachmentId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "/attachments/" + + attachmentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueAttachmentCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueAttachmentCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueAttachmentContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueAttachmentContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Attachment identifier within an Issue. Must be unique in the current Issue. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueAttachmentCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string attachmentId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(attachmentId),attachmentId); + await eventListener.AssertMinimumLength(nameof(attachmentId),attachmentId,1); + await eventListener.AssertMaximumLength(nameof(attachmentId),attachmentId,256); + await eventListener.AssertRegEx(nameof(attachmentId),attachmentId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified comment from an Issue. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Attachment identifier within an Issue. Must be unique in the current Issue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueAttachmentDelete(string resourceGroupName, string serviceName, string apiId, string issueId, string attachmentId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "/attachments/" + + global::System.Uri.EscapeDataString(attachmentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueAttachmentDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified comment from an Issue. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueAttachmentDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)/attachments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var attachmentId = _match.Groups["attachmentId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "/attachments/" + + attachmentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueAttachmentDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueAttachmentDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Attachment identifier within an Issue. Must be unique in the current Issue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueAttachmentDelete_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string attachmentId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(attachmentId),attachmentId); + await eventListener.AssertMinimumLength(nameof(attachmentId),attachmentId,1); + await eventListener.AssertMaximumLength(nameof(attachmentId),attachmentId,256); + await eventListener.AssertRegEx(nameof(attachmentId),attachmentId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the details of the issue Attachment for an API specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Attachment identifier within an Issue. Must be unique in the current Issue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueAttachmentGet(string resourceGroupName, string serviceName, string apiId, string issueId, string attachmentId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "/attachments/" + + global::System.Uri.EscapeDataString(attachmentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueAttachmentGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Attachment identifier within an Issue. Must be unique in the current Issue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueAttachmentGetEntityTag(string resourceGroupName, string serviceName, string apiId, string issueId, string attachmentId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "/attachments/" + + global::System.Uri.EscapeDataString(attachmentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueAttachmentGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueAttachmentGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)/attachments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var attachmentId = _match.Groups["attachmentId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "/attachments/" + + attachmentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueAttachmentGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueAttachmentGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Attachment identifier within an Issue. Must be unique in the current Issue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueAttachmentGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string attachmentId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(attachmentId),attachmentId); + await eventListener.AssertMinimumLength(nameof(attachmentId),attachmentId,1); + await eventListener.AssertMaximumLength(nameof(attachmentId),attachmentId,256); + await eventListener.AssertRegEx(nameof(attachmentId),attachmentId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the details of the issue Attachment for an API specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueAttachmentGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)/attachments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var attachmentId = _match.Groups["attachmentId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "/attachments/" + + attachmentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueAttachmentGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueAttachmentGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueAttachmentContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Attachment identifier within an Issue. Must be unique in the current Issue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueAttachmentGet_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string attachmentId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(attachmentId),attachmentId); + await eventListener.AssertMinimumLength(nameof(attachmentId),attachmentId,1); + await eventListener.AssertMaximumLength(nameof(attachmentId),attachmentId,256); + await eventListener.AssertRegEx(nameof(attachmentId),attachmentId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all attachments for the Issue associated with the specified API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueAttachmentListByService(string resourceGroupName, string serviceName, string apiId, string issueId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "/attachments" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueAttachmentListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all attachments for the Issue associated with the specified API. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueAttachmentListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)/attachments$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "/attachments" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueAttachmentListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueAttachmentListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueAttachmentCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueAttachmentListByService_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a new Comment for the Issue in an API or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Comment identifier within an Issue. Must be unique in the current Issue. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCommentCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string issueId, string commentId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "/comments/" + + global::System.Uri.EscapeDataString(commentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCommentCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new Comment for the Issue in an API or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCommentCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)/comments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var commentId = _match.Groups["commentId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "/comments/" + + commentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCommentCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCommentCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueCommentContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueCommentContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Comment identifier within an Issue. Must be unique in the current Issue. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCommentCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string commentId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(commentId),commentId); + await eventListener.AssertMinimumLength(nameof(commentId),commentId,1); + await eventListener.AssertMaximumLength(nameof(commentId),commentId,256); + await eventListener.AssertRegEx(nameof(commentId),commentId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified comment from an Issue. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Comment identifier within an Issue. Must be unique in the current Issue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCommentDelete(string resourceGroupName, string serviceName, string apiId, string issueId, string commentId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "/comments/" + + global::System.Uri.EscapeDataString(commentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCommentDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified comment from an Issue. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCommentDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)/comments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var commentId = _match.Groups["commentId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "/comments/" + + commentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCommentDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCommentDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Comment identifier within an Issue. Must be unique in the current Issue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCommentDelete_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string commentId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(commentId),commentId); + await eventListener.AssertMinimumLength(nameof(commentId),commentId,1); + await eventListener.AssertMaximumLength(nameof(commentId),commentId,256); + await eventListener.AssertRegEx(nameof(commentId),commentId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the issue Comment for an API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Comment identifier within an Issue. Must be unique in the current Issue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCommentGet(string resourceGroupName, string serviceName, string apiId, string issueId, string commentId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "/comments/" + + global::System.Uri.EscapeDataString(commentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCommentGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Comment identifier within an Issue. Must be unique in the current Issue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCommentGetEntityTag(string resourceGroupName, string serviceName, string apiId, string issueId, string commentId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "/comments/" + + global::System.Uri.EscapeDataString(commentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCommentGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCommentGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)/comments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var commentId = _match.Groups["commentId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "/comments/" + + commentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCommentGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCommentGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Comment identifier within an Issue. Must be unique in the current Issue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCommentGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string commentId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(commentId),commentId); + await eventListener.AssertMinimumLength(nameof(commentId),commentId,1); + await eventListener.AssertMaximumLength(nameof(commentId),commentId,256); + await eventListener.AssertRegEx(nameof(commentId),commentId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the issue Comment for an API specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCommentGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)/comments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var commentId = _match.Groups["commentId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "/comments/" + + commentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCommentGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCommentGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueCommentContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Comment identifier within an Issue. Must be unique in the current Issue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCommentGet_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string commentId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(commentId),commentId); + await eventListener.AssertMinimumLength(nameof(commentId),commentId,1); + await eventListener.AssertMaximumLength(nameof(commentId),commentId,256); + await eventListener.AssertRegEx(nameof(commentId),commentId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all comments for the Issue associated with the specified API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCommentListByService(string resourceGroupName, string serviceName, string apiId, string issueId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "/comments" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCommentListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all comments for the Issue associated with the specified API. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCommentListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)/comments$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "/comments" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCommentListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCommentListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueCommentCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCommentListByService_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a new Issue for an API or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string issueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new Issue for an API or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified Issue from an API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueDelete(string resourceGroupName, string serviceName, string apiId, string issueId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified Issue from an API. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueDelete_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Issue for an API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Expand the comment attachments. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueGet(string resourceGroupName, string serviceName, string apiId, string issueId, bool? expandCommentsAttachments, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "?" + + (null == expandCommentsAttachments ? global::System.String.Empty : "expandCommentsAttachments=" + global::System.Uri.EscapeDataString(expandCommentsAttachments.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueGetEntityTag(string resourceGroupName, string serviceName, string apiId, string issueId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Issue for an API specified by its identifier. + /// + /// Expand the comment attachments. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueGetViaIdentity(global::System.String viaIdentity, bool? expandCommentsAttachments, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "?" + + (null == expandCommentsAttachments ? global::System.String.Empty : "expandCommentsAttachments=" + global::System.Uri.EscapeDataString(expandCommentsAttachments.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// Expand the comment attachments. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueGet_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, bool? expandCommentsAttachments, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all issues associated with the specified API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
+ /// Expand the comment attachments. + /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueListByService(string resourceGroupName, string serviceName, string apiId, string Filter, bool? expandCommentsAttachments, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == expandCommentsAttachments ? global::System.String.Empty : "expandCommentsAttachments=" + global::System.Uri.EscapeDataString(expandCommentsAttachments.ToString())) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all issues associated with the specified API. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
+ /// Expand the comment attachments. + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueListByServiceViaIdentity(global::System.String viaIdentity, string Filter, bool? expandCommentsAttachments, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == expandCommentsAttachments ? global::System.String.Empty : "expandCommentsAttachments=" + global::System.Uri.EscapeDataString(expandCommentsAttachments.ToString())) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
+ /// Expand the comment attachments. + /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueListByService_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, bool? expandCommentsAttachments, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates an existing issue for an API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueUpdate(string resourceGroupName, string serviceName, string apiId, string issueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates an existing issue for an API. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiIssueUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/issues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var issueId = _match.Groups["issueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/issues/" + + issueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiIssueUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Issue identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiIssueUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string issueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Lists all APIs of the API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// isCurrent | filter | eq, ne | |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// Include full ApiVersionSet resource in response + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string tags, bool? expandApiVersionSet, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + (null == expandApiVersionSet ? global::System.String.Empty : "expandApiVersionSet=" + global::System.Uri.EscapeDataString(expandApiVersionSet.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all APIs of the API Management service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// isCurrent | filter | eq, ne | |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// Include full ApiVersionSet resource in response + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string tags, bool? expandApiVersionSet, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + (null == expandApiVersionSet ? global::System.String.Empty : "expandApiVersionSet=" + global::System.Uri.EscapeDataString(expandApiVersionSet.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// isCurrent | filter | eq, ne | |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// Include full ApiVersionSet resource in response + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string tags, bool? expandApiVersionSet, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(tags),tags); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of apis associated with tags. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + /// |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| isCurrent | + /// filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// Include not tagged APIs. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiListByTags(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? includeNotTaggedApis, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apisByTags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == includeNotTaggedApis ? global::System.String.Empty : "includeNotTaggedApis=" + global::System.Uri.EscapeDataString(includeNotTaggedApis.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiListByTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of apis associated with tags. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + /// |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| isCurrent | + /// filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// Include not tagged APIs. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiListByTagsViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, bool? includeNotTaggedApis, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apisByTags$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apisByTags'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apisByTags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == includeNotTaggedApis ? global::System.String.Empty : "includeNotTaggedApis=" + global::System.Uri.EscapeDataString(includeNotTaggedApis.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiListByTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiListByTags_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + /// |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| isCurrent | + /// filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// Include not tagged APIs. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiListByTags_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? includeNotTaggedApis, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementOperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ApiManagement/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementOperationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementOperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.ApiManagement/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.ApiManagement/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ApiManagement/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementOperationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementOperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementOperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// + /// Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all + /// the regions in which the Api Management service is deployed will be updated sequentially without incurring downtime in + /// the region. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceApplyNetworkConfigurationUpdates(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceApplyNetworkConfigurationParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/applynetworkconfigurationupdates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceApplyNetworkConfigurationUpdates_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + /// + /// + /// Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all + /// the regions in which the Api Management service is deployed will be updated sequentially without incurring downtime in + /// the region. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceApplyNetworkConfigurationUpdatesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceApplyNetworkConfigurationParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/applynetworkconfigurationupdates$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/applynetworkconfigurationupdates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceApplyNetworkConfigurationUpdates_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceApplyNetworkConfigurationUpdates_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all + /// the regions in which the Api Management service is deployed will be updated sequentially without incurring downtime in + /// the region. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceApplyNetworkConfigurationUpdates_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceApplyNetworkConfigurationParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation and + /// could take several minutes to complete. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the ApiManagementService_Backup operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceBackup(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/backup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceBackup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation and + /// could take several minutes to complete. + /// + /// + /// Parameters supplied to the ApiManagementService_Backup operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceBackupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/backup$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/backup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceBackup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceBackup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the ApiManagementService_Backup operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceBackup_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Checks availability and correctness of a name for an API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the CheckNameAvailability operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceCheckNameAvailability(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceCheckNameAvailabilityParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ApiManagement/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceCheckNameAvailability_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Checks availability and correctness of a name for an API Management service. + /// + /// Parameters supplied to the CheckNameAvailability operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceCheckNameAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceCheckNameAvailabilityParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.ApiManagement/checkNameAvailability$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ApiManagement/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceCheckNameAvailability_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceCheckNameAvailability_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceNameAvailabilityResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the CheckNameAvailability operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceCheckNameAvailability_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceCheckNameAvailabilityParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Creates or updates an API Management service. This is long running operation and could take several minutes to complete. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the CreateOrUpdate API Management service operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceCreateOrUpdate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Creates or updates an API Management service. This is long running operation and could take several minutes to complete. + /// + /// + /// Parameters supplied to the CreateOrUpdate API Management service operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the CreateOrUpdate API Management service operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes an existing API Management service. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceDelete(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes an existing API Management service. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceDelete_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets an API Management service resource description. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceGet(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the custom domain ownership identifier for an API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceGetDomainOwnershipIdentifier(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceGetDomainOwnershipIdentifier_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the custom domain ownership identifier for an API Management service. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceGetDomainOwnershipIdentifierViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceGetDomainOwnershipIdentifier_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceGetDomainOwnershipIdentifier_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceGetDomainOwnershipIdentifierResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceGetDomainOwnershipIdentifier_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceGetSsoToken(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/getssotoken" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceGetSsoToken_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceGetSsoTokenViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/getssotoken$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/getssotoken'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/getssotoken" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceGetSsoToken_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceGetSsoToken_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceGetSsoTokenResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceGetSsoToken_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets an API Management service resource description. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceGet_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all API Management services within an Azure subscription. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ApiManagement/service" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all API Management services within a resource group. + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceListByResourceGroup(string resourceGroupName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all API Management services within a resource group. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceListByResourceGroup_Validate(string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all API Management services within an Azure subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.ApiManagement/service$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ApiManagement/service" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Upgrades an API Management service to the Stv2 platform. For details refer to https://aka.ms/apim-migrate-stv2. This change + /// is not reversible. This is long running operation and could take several minutes to complete. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Optional parameters supplied to migrate service. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceMigrateToStv2(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IMigrateToStv2Contract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/migrateToStv2" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceMigrateToStv2_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Upgrades an API Management service to the Stv2 platform. For details refer to https://aka.ms/apim-migrate-stv2. This change + /// is not reversible. This is long running operation and could take several minutes to complete. + /// + /// + /// Optional parameters supplied to migrate service. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceMigrateToStv2ViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IMigrateToStv2Contract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/migrateToStv2$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/migrateToStv2'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/migrateToStv2" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceMigrateToStv2_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceMigrateToStv2_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Optional parameters supplied to migrate service. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceMigrateToStv2_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IMigrateToStv2Contract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the current + /// service. This is a long running operation and could take several minutes to complete. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the Restore API Management service from backup operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceRestore(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/restore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceRestore_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the current + /// service. This is a long running operation and could take several minutes to complete. + /// + /// + /// Parameters supplied to the Restore API Management service from backup operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceRestoreViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/restore$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/restore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceRestore_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceRestore_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the Restore API Management service from backup operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceRestore_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets all available SKU for a given API Management service + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceSkusListAvailableServiceSkus(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/skus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceSkusListAvailableServiceSkus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all available SKU for a given API Management service + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceSkusListAvailableServiceSkusViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/skus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/skus'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/skus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceSkusListAvailableServiceSkus_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceSkusListAvailableServiceSkus_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceSkuResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceSkusListAvailableServiceSkus_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates an existing API Management service. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the CreateOrUpdate API Management service operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceUpdate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates an existing API Management service. + /// + /// Parameters supplied to the CreateOrUpdate API Management service operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementServiceUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementServiceUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to the CreateOrUpdate API Management service operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementServiceUpdate_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementSkusList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ApiManagement/skus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementSkusList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiManagementSkusListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.ApiManagement/skus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ApiManagement/skus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiManagementSkusList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementSkusList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkusResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiManagementSkusList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a new operation in the API or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new operation in the API or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified operation in the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationDelete(string resourceGroupName, string serviceName, string apiId, string operationId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified operation in the API. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationDelete_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the API Operation specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationGet(string resourceGroupName, string serviceName, string apiId, string operationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API operation specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationGetEntityTag(string resourceGroupName, string serviceName, string apiId, string operationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API operation specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the API Operation specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationGet_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the operations for the specified API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationListByApi(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string tags, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the operations for the specified API. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationListByApiViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string tags, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationListByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationListByApi_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string tags, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(tags),tags); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates policy configuration for the API Operation level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationPolicyCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates policy configuration for the API Operation level. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationPolicyCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationPolicyCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationPolicyCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the policy configuration at the Api Operation. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationPolicyDelete(string resourceGroupName, string serviceName, string apiId, string operationId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the policy configuration at the Api Operation. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationPolicyDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationPolicyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationPolicyDelete_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API Operation level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationPolicyGet(string resourceGroupName, string serviceName, string apiId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API operation policy specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationPolicyGetEntityTag(string resourceGroupName, string serviceName, string apiId, string operationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API operation policy specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationPolicyGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationPolicyGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationPolicyGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API Operation level. + /// + /// Policy Export Format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationPolicyGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/policies/" + + policyId + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationPolicyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationPolicyGet_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the list of policy configuration at the API Operation level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationPolicyListByOperation(string resourceGroupName, string serviceName, string apiId, string operationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationPolicyListByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the list of policy configuration at the API Operation level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationPolicyListByOperationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationPolicyListByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationPolicyListByOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationPolicyListByOperation_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the operation in the API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Operation Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationUpdate(string resourceGroupName, string serviceName, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the operation in the API specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// API Operation Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiOperationUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiOperationUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Operation Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiOperationUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates policy configuration for the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiPolicyCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates policy configuration for the API. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiPolicyCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiPolicyCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiPolicyCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the policy configuration at the Api. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiPolicyDelete(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the policy configuration at the Api. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiPolicyDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiPolicyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiPolicyDelete_Validate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiPolicyGet(string resourceGroupName, string serviceName, string apiId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiPolicyGet_Call(request,onOk,onOk,onDefault,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API policy specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiPolicyGetEntityTag(string resourceGroupName, string serviceName, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API policy specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiPolicyGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiPolicyGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiPolicyGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API level. + /// + /// Policy Export Format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiPolicyGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/policies/" + + policyId + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiPolicyGet_Call(request,onOk,onOk,onDefault,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiPolicyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( global::System.Xml.Linq.XElement.Parse(body.Result), out var __y) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(__y) : null)); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( global::System.Xml.Linq.XElement.Parse(body.Result), out var __y) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(__y) : null)); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiPolicyGet_Validate(string resourceGroupName, string serviceName, string apiId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiPolicyListByApi(string resourceGroupName, string serviceName, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiPolicyListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the policy configuration at the API level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiPolicyListByApiViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiPolicyListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiPolicyListByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiPolicyListByApi_Validate(string resourceGroupName, string serviceName, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all Products, which the API is part of. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiProductListByApis(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/products" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiProductListByApis_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all Products, which the API is part of. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiProductListByApisViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/products$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/products'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/products" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiProductListByApis_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiProductListByApis_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiProductListByApis_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a new Release for the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string releaseId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases/" + + global::System.Uri.EscapeDataString(releaseId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new Release for the API. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/releases/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var releaseId = _match.Groups["releaseId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/releases/" + + releaseId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string releaseId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(releaseId),releaseId); + await eventListener.AssertMinimumLength(nameof(releaseId),releaseId,1); + await eventListener.AssertMaximumLength(nameof(releaseId),releaseId,80); + await eventListener.AssertRegEx(nameof(releaseId),releaseId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified release in the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseDelete(string resourceGroupName, string serviceName, string apiId, string releaseId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases/" + + global::System.Uri.EscapeDataString(releaseId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified release in the API. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/releases/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var releaseId = _match.Groups["releaseId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/releases/" + + releaseId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseDelete_Validate(string resourceGroupName, string serviceName, string apiId, string releaseId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(releaseId),releaseId); + await eventListener.AssertMinimumLength(nameof(releaseId),releaseId,1); + await eventListener.AssertMaximumLength(nameof(releaseId),releaseId,80); + await eventListener.AssertRegEx(nameof(releaseId),releaseId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Returns the details of an API release. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseGet(string resourceGroupName, string serviceName, string apiId, string releaseId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases/" + + global::System.Uri.EscapeDataString(releaseId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the etag of an API release. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseGetEntityTag(string resourceGroupName, string serviceName, string apiId, string releaseId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases/" + + global::System.Uri.EscapeDataString(releaseId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the etag of an API release. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/releases/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var releaseId = _match.Groups["releaseId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/releases/" + + releaseId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string releaseId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(releaseId),releaseId); + await eventListener.AssertMinimumLength(nameof(releaseId),releaseId,1); + await eventListener.AssertMaximumLength(nameof(releaseId),releaseId,80); + await eventListener.AssertRegEx(nameof(releaseId),releaseId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Returns the details of an API release. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/releases/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var releaseId = _match.Groups["releaseId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/releases/" + + releaseId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseGet_Validate(string resourceGroupName, string serviceName, string apiId, string releaseId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(releaseId),releaseId); + await eventListener.AssertMinimumLength(nameof(releaseId),releaseId,1); + await eventListener.AssertMaximumLength(nameof(releaseId),releaseId,80); + await eventListener.AssertRegEx(nameof(releaseId),releaseId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists all releases of an API. An API release is created when making an API Revision current. Releases are also used to + /// rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip parameters. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseListByService(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all releases of an API. An API release is created when making an API Revision current. Releases are also used to + /// rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip parameters. + /// + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/releases$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/releases" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseListByService_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the release of the API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Release Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseUpdate(string resourceGroupName, string serviceName, string apiId, string releaseId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases/" + + global::System.Uri.EscapeDataString(releaseId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the release of the API specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// API Release Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiReleaseUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/releases/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var releaseId = _match.Groups["releaseId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/releases/" + + releaseId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiReleaseUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Release Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiReleaseUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string releaseId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(releaseId),releaseId); + await eventListener.AssertMinimumLength(nameof(releaseId),releaseId,1); + await eventListener.AssertMaximumLength(nameof(releaseId),releaseId,80); + await eventListener.AssertRegEx(nameof(releaseId),releaseId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Lists all revisions of an API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiRevisionListByService(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/revisions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiRevisionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all revisions of an API. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiRevisionListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/revisions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/revisions'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/revisions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiRevisionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiRevisionListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiRevisionCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiRevisionListByService_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates schema configuration for the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The schema contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiSchemaCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string schemaId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiSchemaCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates schema configuration for the API. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The schema contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiSchemaCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiSchemaCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiSchemaCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The schema contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiSchemaCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string schemaId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the schema configuration at the Api. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// If true removes all references to the schema before deleting it. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiSchemaDelete(string resourceGroupName, string serviceName, string apiId, string schemaId, bool? force, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + (null == force ? global::System.String.Empty : "force=" + global::System.Uri.EscapeDataString(force.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiSchemaDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the schema configuration at the Api. + /// + /// If true removes all references to the schema before deleting it. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiSchemaDeleteViaIdentity(global::System.String viaIdentity, bool? force, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/schemas/" + + schemaId + + "?" + + (null == force ? global::System.String.Empty : "force=" + global::System.Uri.EscapeDataString(force.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiSchemaDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiSchemaDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// If true removes all references to the schema before deleting it. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiSchemaDelete_Validate(string resourceGroupName, string serviceName, string apiId, string schemaId, bool? force, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the schema configuration at the API level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiSchemaGet(string resourceGroupName, string serviceName, string apiId, string schemaId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiSchemaGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the schema specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiSchemaGetEntityTag(string resourceGroupName, string serviceName, string apiId, string schemaId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiSchemaGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the schema specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiSchemaGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiSchemaGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiSchemaGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiSchemaGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string schemaId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the schema configuration at the API level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiSchemaGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiSchemaGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiSchemaGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiSchemaGet_Validate(string resourceGroupName, string serviceName, string apiId, string schemaId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the schema configuration at the API level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiSchemaListByApi(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/schemas" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiSchemaListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the schema configuration at the API level. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiSchemaListByApiViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/schemas$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/schemas" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiSchemaListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiSchemaListByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiSchemaListByApi_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Create/Update tag description in scope of the Api. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag description identifier. Used when creating tagDescription for API/Tag association. + /// Based on API and Tag names. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiTagDescriptionCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/tagDescriptions/" + + global::System.Uri.EscapeDataString(tagDescriptionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiTagDescriptionCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Create/Update tag description in scope of the Api. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiTagDescriptionCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/tagDescriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var tagDescriptionId = _match.Groups["tagDescriptionId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/tagDescriptions/" + + tagDescriptionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiTagDescriptionCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiTagDescriptionCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag description identifier. Used when creating tagDescription for API/Tag association. + /// Based on API and Tag names. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiTagDescriptionCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCreateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagDescriptionId),tagDescriptionId); + await eventListener.AssertMinimumLength(nameof(tagDescriptionId),tagDescriptionId,1); + await eventListener.AssertMaximumLength(nameof(tagDescriptionId),tagDescriptionId,80); + await eventListener.AssertRegEx(nameof(tagDescriptionId),tagDescriptionId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete tag description for the Api. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag description identifier. Used when creating tagDescription for API/Tag association. + /// Based on API and Tag names. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiTagDescriptionDelete(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/tagDescriptions/" + + global::System.Uri.EscapeDataString(tagDescriptionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiTagDescriptionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete tag description for the Api. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiTagDescriptionDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/tagDescriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var tagDescriptionId = _match.Groups["tagDescriptionId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/tagDescriptions/" + + tagDescriptionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiTagDescriptionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiTagDescriptionDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag description identifier. Used when creating tagDescription for API/Tag association. + /// Based on API and Tag names. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiTagDescriptionDelete_Validate(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagDescriptionId),tagDescriptionId); + await eventListener.AssertMinimumLength(nameof(tagDescriptionId),tagDescriptionId,1); + await eventListener.AssertMaximumLength(nameof(tagDescriptionId),tagDescriptionId,80); + await eventListener.AssertRegEx(nameof(tagDescriptionId),tagDescriptionId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get Tag description in scope of API + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag description identifier. Used when creating tagDescription for API/Tag association. + /// Based on API and Tag names. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiTagDescriptionGet(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/tagDescriptions/" + + global::System.Uri.EscapeDataString(tagDescriptionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiTagDescriptionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag description identifier. Used when creating tagDescription for API/Tag association. + /// Based on API and Tag names. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiTagDescriptionGetEntityTag(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/tagDescriptions/" + + global::System.Uri.EscapeDataString(tagDescriptionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiTagDescriptionGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiTagDescriptionGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/tagDescriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var tagDescriptionId = _match.Groups["tagDescriptionId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/tagDescriptions/" + + tagDescriptionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiTagDescriptionGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiTagDescriptionGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag description identifier. Used when creating tagDescription for API/Tag association. + /// Based on API and Tag names. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiTagDescriptionGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagDescriptionId),tagDescriptionId); + await eventListener.AssertMinimumLength(nameof(tagDescriptionId),tagDescriptionId,1); + await eventListener.AssertMaximumLength(nameof(tagDescriptionId),tagDescriptionId,80); + await eventListener.AssertRegEx(nameof(tagDescriptionId),tagDescriptionId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get Tag description in scope of API + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiTagDescriptionGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/tagDescriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var tagDescriptionId = _match.Groups["tagDescriptionId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/tagDescriptions/" + + tagDescriptionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiTagDescriptionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiTagDescriptionGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag description identifier. Used when creating tagDescription for API/Tag association. + /// Based on API and Tag names. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiTagDescriptionGet_Validate(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagDescriptionId),tagDescriptionId); + await eventListener.AssertMinimumLength(nameof(tagDescriptionId),tagDescriptionId,1); + await eventListener.AssertMaximumLength(nameof(tagDescriptionId),tagDescriptionId,80); + await eventListener.AssertRegEx(nameof(tagDescriptionId),tagDescriptionId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level but tag + /// may be assigned to the Operations + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiTagDescriptionListByService(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/tagDescriptions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiTagDescriptionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level but tag + /// may be assigned to the Operations + /// + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiTagDescriptionListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/tagDescriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/tagDescriptions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiTagDescriptionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiTagDescriptionListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiTagDescriptionListByService_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the specified API of the API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Update Contract parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiUpdate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the specified API of the API Management service instance. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// API Update Contract parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Update Contract parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or Updates a Api Version Set. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetCreateOrUpdate(string resourceGroupName, string serviceName, string versionSetId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apiVersionSets/" + + global::System.Uri.EscapeDataString(versionSetId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or Updates a Api Version Set. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apiVersionSets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var versionSetId = _match.Groups["versionSetId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apiVersionSets/" + + versionSetId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string versionSetId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(versionSetId),versionSetId); + await eventListener.AssertMinimumLength(nameof(versionSetId),versionSetId,1); + await eventListener.AssertMaximumLength(nameof(versionSetId),versionSetId,80); + await eventListener.AssertRegEx(nameof(versionSetId),versionSetId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific Api Version Set. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetDelete(string resourceGroupName, string serviceName, string versionSetId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apiVersionSets/" + + global::System.Uri.EscapeDataString(versionSetId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific Api Version Set. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apiVersionSets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var versionSetId = _match.Groups["versionSetId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apiVersionSets/" + + versionSetId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetDelete_Validate(string resourceGroupName, string serviceName, string versionSetId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(versionSetId),versionSetId); + await eventListener.AssertMinimumLength(nameof(versionSetId),versionSetId,1); + await eventListener.AssertMaximumLength(nameof(versionSetId),versionSetId,80); + await eventListener.AssertRegEx(nameof(versionSetId),versionSetId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Api Version Set specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetGet(string resourceGroupName, string serviceName, string versionSetId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apiVersionSets/" + + global::System.Uri.EscapeDataString(versionSetId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetGetEntityTag(string resourceGroupName, string serviceName, string versionSetId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apiVersionSets/" + + global::System.Uri.EscapeDataString(versionSetId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apiVersionSets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var versionSetId = _match.Groups["versionSetId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apiVersionSets/" + + versionSetId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetGetEntityTag_Validate(string resourceGroupName, string serviceName, string versionSetId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(versionSetId),versionSetId); + await eventListener.AssertMinimumLength(nameof(versionSetId),versionSetId,1); + await eventListener.AssertMaximumLength(nameof(versionSetId),versionSetId,80); + await eventListener.AssertRegEx(nameof(versionSetId),versionSetId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Api Version Set specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apiVersionSets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var versionSetId = _match.Groups["versionSetId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apiVersionSets/" + + versionSetId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetGet_Validate(string resourceGroupName, string serviceName, string versionSetId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(versionSetId),versionSetId); + await eventListener.AssertMinimumLength(nameof(versionSetId),versionSetId,1); + await eventListener.AssertMaximumLength(nameof(versionSetId),versionSetId,80); + await eventListener.AssertRegEx(nameof(versionSetId),versionSetId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of API Version Sets in the specified service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apiVersionSets" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of API Version Sets in the specified service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apiVersionSets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apiVersionSets" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the Api VersionSet specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetUpdate(string resourceGroupName, string serviceName, string versionSetId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apiVersionSets/" + + global::System.Uri.EscapeDataString(versionSetId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the Api VersionSet specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiVersionSetUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apiVersionSets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var versionSetId = _match.Groups["versionSetId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apiVersionSets/" + + versionSetId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiVersionSetUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiVersionSetUpdate_Validate(string resourceGroupName, string serviceName, string versionSetId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(versionSetId),versionSetId); + await eventListener.AssertMinimumLength(nameof(versionSetId),versionSetId,1); + await eventListener.AssertMaximumLength(nameof(versionSetId),versionSetId,80); + await eventListener.AssertRegEx(nameof(versionSetId),versionSetId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates a new Wiki for an API or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikiCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikiCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new Wiki for an API or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikiCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/wikis/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikiCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikiCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikiCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified Wiki from an API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikiDelete(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikiDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified Wiki from an API. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikiDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/wikis/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikiDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikiDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikiDelete_Validate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Wiki for an API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikiGet(string resourceGroupName, string serviceName, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikiGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Wiki for an API specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikiGetEntityTag(string resourceGroupName, string serviceName, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikiGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Wiki for an API specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikiGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/wikis/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikiGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikiGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikiGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Wiki for an API specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikiGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/wikis/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikiGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikiGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikiGet_Validate(string resourceGroupName, string serviceName, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the Wiki for an API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Wiki Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikiUpdate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikiUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the Wiki for an API specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Wiki Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikiUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/wikis/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikiUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikiUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Wiki Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikiUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets the wikis for an API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq | contains |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikisList(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/wikis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikisList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the wikis for an API specified by its identifier. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq | contains |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApiWikisListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/wikis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/wikis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiWikisList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikisList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq | contains |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApiWikisList_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates Authorization Access Policy. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// Identifier of the authorization access policy. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationAccessPolicyCreateOrUpdate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string authorizationAccessPolicyId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationId) + + "/accessPolicies/" + + global::System.Uri.EscapeDataString(authorizationAccessPolicyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationAccessPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates Authorization Access Policy. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationAccessPolicyCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)/authorizations/(?[^/]+)/accessPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies/{authorizationAccessPolicyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var authorizationId = _match.Groups["authorizationId"].Value; + var authorizationAccessPolicyId = _match.Groups["authorizationAccessPolicyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "/authorizations/" + + authorizationId + + "/accessPolicies/" + + authorizationAccessPolicyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationAccessPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationAccessPolicyCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationAccessPolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationAccessPolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// Identifier of the authorization access policy. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationAccessPolicyCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string authorizationAccessPolicyId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationId),authorizationId); + await eventListener.AssertMinimumLength(nameof(authorizationId),authorizationId,1); + await eventListener.AssertMaximumLength(nameof(authorizationId),authorizationId,256); + await eventListener.AssertRegEx(nameof(authorizationId),authorizationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId); + await eventListener.AssertMinimumLength(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId,1); + await eventListener.AssertMaximumLength(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId,256); + await eventListener.AssertRegEx(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific access policy from the Authorization. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// Identifier of the authorization access policy. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationAccessPolicyDelete(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string authorizationAccessPolicyId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationId) + + "/accessPolicies/" + + global::System.Uri.EscapeDataString(authorizationAccessPolicyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationAccessPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific access policy from the Authorization. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationAccessPolicyDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)/authorizations/(?[^/]+)/accessPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies/{authorizationAccessPolicyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var authorizationId = _match.Groups["authorizationId"].Value; + var authorizationAccessPolicyId = _match.Groups["authorizationAccessPolicyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "/authorizations/" + + authorizationId + + "/accessPolicies/" + + authorizationAccessPolicyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationAccessPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationAccessPolicyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// Identifier of the authorization access policy. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationAccessPolicyDelete_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string authorizationAccessPolicyId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationId),authorizationId); + await eventListener.AssertMinimumLength(nameof(authorizationId),authorizationId,1); + await eventListener.AssertMaximumLength(nameof(authorizationId),authorizationId,256); + await eventListener.AssertRegEx(nameof(authorizationId),authorizationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId); + await eventListener.AssertMinimumLength(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId,1); + await eventListener.AssertMaximumLength(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId,256); + await eventListener.AssertRegEx(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the details of the authorization access policy specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// Identifier of the authorization access policy. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationAccessPolicyGet(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string authorizationAccessPolicyId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationId) + + "/accessPolicies/" + + global::System.Uri.EscapeDataString(authorizationAccessPolicyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationAccessPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the details of the authorization access policy specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationAccessPolicyGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)/authorizations/(?[^/]+)/accessPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies/{authorizationAccessPolicyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var authorizationId = _match.Groups["authorizationId"].Value; + var authorizationAccessPolicyId = _match.Groups["authorizationAccessPolicyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "/authorizations/" + + authorizationId + + "/accessPolicies/" + + authorizationAccessPolicyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationAccessPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationAccessPolicyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationAccessPolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// Identifier of the authorization access policy. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationAccessPolicyGet_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string authorizationAccessPolicyId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationId),authorizationId); + await eventListener.AssertMinimumLength(nameof(authorizationId),authorizationId,1); + await eventListener.AssertMaximumLength(nameof(authorizationId),authorizationId,256); + await eventListener.AssertRegEx(nameof(authorizationId),authorizationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId); + await eventListener.AssertMinimumLength(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId,1); + await eventListener.AssertMaximumLength(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId,256); + await eventListener.AssertRegEx(nameof(authorizationAccessPolicyId),authorizationAccessPolicyId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists a collection of authorization access policy defined within a authorization. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationAccessPolicyListByAuthorization(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationId) + + "/accessPolicies" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationAccessPolicyListByAuthorization_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists a collection of authorization access policy defined within a authorization. + /// + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationAccessPolicyListByAuthorizationViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)/authorizations/(?[^/]+)/accessPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var authorizationId = _match.Groups["authorizationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "/authorizations/" + + authorizationId + + "/accessPolicies" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationAccessPolicyListByAuthorization_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationAccessPolicyListByAuthorization_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationAccessPolicyCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationAccessPolicyListByAuthorization_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationId),authorizationId); + await eventListener.AssertMinimumLength(nameof(authorizationId),authorizationId,1); + await eventListener.AssertMaximumLength(nameof(authorizationId),authorizationId,256); + await eventListener.AssertRegEx(nameof(authorizationId),authorizationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Confirm valid consent code to suppress Authorizations anti-phishing page. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationConfirmConsentCode(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationConfirmConsentCodeRequestContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationId) + + "/confirmConsentCode" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationConfirmConsentCode_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Confirm valid consent code to suppress Authorizations anti-phishing page. + /// + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationConfirmConsentCodeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationConfirmConsentCodeRequestContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)/authorizations/(?[^/]+)/confirmConsentCode$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/confirmConsentCode'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var authorizationId = _match.Groups["authorizationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "/authorizations/" + + authorizationId + + "/confirmConsentCode" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationConfirmConsentCode_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationConfirmConsentCode_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationConfirmConsentCode_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationConfirmConsentCodeRequestContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationId),authorizationId); + await eventListener.AssertMinimumLength(nameof(authorizationId),authorizationId,1); + await eventListener.AssertMaximumLength(nameof(authorizationId),authorizationId,256); + await eventListener.AssertRegEx(nameof(authorizationId),authorizationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates authorization. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationCreateOrUpdate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates authorization. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)/authorizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var authorizationId = _match.Groups["authorizationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "/authorizations/" + + authorizationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationId),authorizationId); + await eventListener.AssertMinimumLength(nameof(authorizationId),authorizationId,1); + await eventListener.AssertMaximumLength(nameof(authorizationId),authorizationId,256); + await eventListener.AssertRegEx(nameof(authorizationId),authorizationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific Authorization from the Authorization provider. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationDelete(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific Authorization from the Authorization provider. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)/authorizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var authorizationId = _match.Groups["authorizationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "/authorizations/" + + authorizationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationDelete_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationId),authorizationId); + await eventListener.AssertMinimumLength(nameof(authorizationId),authorizationId,1); + await eventListener.AssertMaximumLength(nameof(authorizationId),authorizationId,256); + await eventListener.AssertRegEx(nameof(authorizationId),authorizationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the authorization specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationGet(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the details of the authorization specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)/authorizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var authorizationId = _match.Groups["authorizationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "/authorizations/" + + authorizationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationGet_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationId),authorizationId); + await eventListener.AssertMinimumLength(nameof(authorizationId),authorizationId,1); + await eventListener.AssertMaximumLength(nameof(authorizationId),authorizationId,256); + await eventListener.AssertRegEx(nameof(authorizationId),authorizationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists a collection of authorization providers defined within a authorization provider. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationListByAuthorizationProvider(string resourceGroupName, string serviceName, string authorizationProviderId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "/authorizations" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationListByAuthorizationProvider_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists a collection of authorization providers defined within a authorization provider. + /// + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationListByAuthorizationProviderViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)/authorizations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "/authorizations" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationListByAuthorizationProvider_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationListByAuthorizationProvider_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationListByAuthorizationProvider_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets authorization login links. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationLoginLinksPost(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginRequestContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationId) + + "/getLoginLinks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationLoginLinksPost_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets authorization login links. + /// + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationLoginLinksPostViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginRequestContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)/authorizations/(?[^/]+)/getLoginLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/getLoginLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var authorizationId = _match.Groups["authorizationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "/authorizations/" + + authorizationId + + "/getLoginLinks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationLoginLinksPost_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationLoginLinksPost_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationLoginResponseContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// Identifier of the authorization. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationLoginLinksPost_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string authorizationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginRequestContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(authorizationId),authorizationId); + await eventListener.AssertMinimumLength(nameof(authorizationId),authorizationId,1); + await eventListener.AssertMaximumLength(nameof(authorizationId),authorizationId,256); + await eventListener.AssertRegEx(nameof(authorizationId),authorizationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates authorization provider. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationProviderCreateOrUpdate(string resourceGroupName, string serviceName, string authorizationProviderId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationProviderCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates authorization provider. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationProviderCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationProviderCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationProviderCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationProviderCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Deletes specific authorization provider from the API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationProviderDelete(string resourceGroupName, string serviceName, string authorizationProviderId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationProviderDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Deletes specific authorization provider from the API Management service instance. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationProviderDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationProviderDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationProviderDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationProviderDelete_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the authorization provider specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationProviderGet(string resourceGroupName, string serviceName, string authorizationProviderId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders/" + + global::System.Uri.EscapeDataString(authorizationProviderId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationProviderGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the details of the authorization provider specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationProviderGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authorizationProviderId = _match.Groups["authorizationProviderId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders/" + + authorizationProviderId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationProviderGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationProviderGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization provider. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationProviderGet_Validate(string resourceGroupName, string serviceName, string authorizationProviderId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authorizationProviderId),authorizationProviderId); + await eventListener.AssertMinimumLength(nameof(authorizationProviderId),authorizationProviderId,1); + await eventListener.AssertMaximumLength(nameof(authorizationProviderId),authorizationProviderId,256); + await eventListener.AssertRegEx(nameof(authorizationProviderId),authorizationProviderId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists a collection of authorization providers defined within a service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationProviderListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationProviders" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationProviderListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists a collection of authorization providers defined within a service instance. + /// + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationProviderListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationProviders$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationProviders" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationProviderListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationProviderListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationProviderListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates new authorization server or updates an existing authorization server. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerCreateOrUpdate(string resourceGroupName, string serviceName, string authsid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationServers/" + + global::System.Uri.EscapeDataString(authsid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates new authorization server or updates an existing authorization server. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationServers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authsid = _match.Groups["authsid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationServers/" + + authsid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string authsid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authsid),authsid); + await eventListener.AssertMinimumLength(nameof(authsid),authsid,1); + await eventListener.AssertMaximumLength(nameof(authsid),authsid,80); + await eventListener.AssertRegEx(nameof(authsid),authsid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific authorization server instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerDelete(string resourceGroupName, string serviceName, string authsid, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationServers/" + + global::System.Uri.EscapeDataString(authsid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific authorization server instance. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationServers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authsid = _match.Groups["authsid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationServers/" + + authsid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerDelete_Validate(string resourceGroupName, string serviceName, string authsid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authsid),authsid); + await eventListener.AssertMinimumLength(nameof(authsid),authsid,1); + await eventListener.AssertMaximumLength(nameof(authsid),authsid,80); + await eventListener.AssertRegEx(nameof(authsid),authsid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the authorization server specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerGet(string resourceGroupName, string serviceName, string authsid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationServers/" + + global::System.Uri.EscapeDataString(authsid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerGetEntityTag(string resourceGroupName, string serviceName, string authsid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationServers/" + + global::System.Uri.EscapeDataString(authsid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationServers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authsid = _match.Groups["authsid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationServers/" + + authsid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerGetEntityTag_Validate(string resourceGroupName, string serviceName, string authsid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authsid),authsid); + await eventListener.AssertMinimumLength(nameof(authsid),authsid,1); + await eventListener.AssertMaximumLength(nameof(authsid),authsid,80); + await eventListener.AssertRegEx(nameof(authsid),authsid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the authorization server specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationServers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authsid = _match.Groups["authsid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationServers/" + + authsid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerGet_Validate(string resourceGroupName, string serviceName, string authsid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authsid),authsid); + await eventListener.AssertMinimumLength(nameof(authsid),authsid,1); + await eventListener.AssertMaximumLength(nameof(authsid),authsid,80); + await eventListener.AssertRegEx(nameof(authsid),authsid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of authorization servers defined within a service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationServers" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of authorization servers defined within a service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationServers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationServers" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the client secret details of the authorization server. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerListSecrets(string resourceGroupName, string serviceName, string authsid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationServers/" + + global::System.Uri.EscapeDataString(authsid) + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the client secret details of the authorization server. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerListSecretsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationServers/(?[^/]+)/listSecrets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authsid = _match.Groups["authsid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationServers/" + + authsid + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerListSecrets_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerSecretsContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerListSecrets_Validate(string resourceGroupName, string serviceName, string authsid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authsid),authsid); + await eventListener.AssertMinimumLength(nameof(authsid),authsid,1); + await eventListener.AssertMaximumLength(nameof(authsid),authsid,80); + await eventListener.AssertRegEx(nameof(authsid),authsid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the authorization server specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// OAuth2 Server settings Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerUpdate(string resourceGroupName, string serviceName, string authsid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/authorizationServers/" + + global::System.Uri.EscapeDataString(authsid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the authorization server specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// OAuth2 Server settings Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AuthorizationServerUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/authorizationServers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var authsid = _match.Groups["authsid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/authorizationServers/" + + authsid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AuthorizationServerUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the authorization server. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// OAuth2 Server settings Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AuthorizationServerUpdate_Validate(string resourceGroupName, string serviceName, string authsid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(authsid),authsid); + await eventListener.AssertMinimumLength(nameof(authsid),authsid,1); + await eventListener.AssertMaximumLength(nameof(authsid),authsid,80); + await eventListener.AssertRegEx(nameof(authsid),authsid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or Updates a backend. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendCreateOrUpdate(string resourceGroupName, string serviceName, string backendId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/backends/" + + global::System.Uri.EscapeDataString(backendId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or Updates a backend. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/backends/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var backendId = _match.Groups["backendId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/backends/" + + backendId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string backendId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(backendId),backendId); + await eventListener.AssertMinimumLength(nameof(backendId),backendId,1); + await eventListener.AssertMaximumLength(nameof(backendId),backendId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified backend. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendDelete(string resourceGroupName, string serviceName, string backendId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/backends/" + + global::System.Uri.EscapeDataString(backendId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified backend. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/backends/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var backendId = _match.Groups["backendId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/backends/" + + backendId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendDelete_Validate(string resourceGroupName, string serviceName, string backendId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(backendId),backendId); + await eventListener.AssertMinimumLength(nameof(backendId),backendId,1); + await eventListener.AssertMaximumLength(nameof(backendId),backendId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the backend specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendGet(string resourceGroupName, string serviceName, string backendId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/backends/" + + global::System.Uri.EscapeDataString(backendId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the backend specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendGetEntityTag(string resourceGroupName, string serviceName, string backendId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/backends/" + + global::System.Uri.EscapeDataString(backendId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the backend specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/backends/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var backendId = _match.Groups["backendId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/backends/" + + backendId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendGetEntityTag_Validate(string resourceGroupName, string serviceName, string backendId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(backendId),backendId); + await eventListener.AssertMinimumLength(nameof(backendId),backendId,1); + await eventListener.AssertMaximumLength(nameof(backendId),backendId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the backend specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/backends/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var backendId = _match.Groups["backendId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/backends/" + + backendId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendGet_Validate(string resourceGroupName, string serviceName, string backendId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(backendId),backendId); + await eventListener.AssertMinimumLength(nameof(backendId),backendId,1); + await eventListener.AssertMaximumLength(nameof(backendId),backendId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of backends in the specified service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| title | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| url | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/backends" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of backends in the specified service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| title | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| url | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/backends$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/backends" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| title | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| url | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Notifies the API Management gateway to create a new connection to the backend after the specified timeout. If no timeout + /// was specified, timeout of 2 minutes is used. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Reconnect request parameters. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendReconnect(string resourceGroupName, string serviceName, string backendId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectContract body, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/backends/" + + global::System.Uri.EscapeDataString(backendId) + + "/reconnect" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendReconnect_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// Notifies the API Management gateway to create a new connection to the backend after the specified timeout. If no timeout + /// was specified, timeout of 2 minutes is used. + /// + /// + /// Reconnect request parameters. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendReconnectViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectContract body, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/backends/(?[^/]+)/reconnect$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}/reconnect'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var backendId = _match.Groups["backendId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/backends/" + + backendId + + "/reconnect" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendReconnect_Call(request,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 202 (Accepted). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendReconnect_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Reconnect request parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendReconnect_Validate(string resourceGroupName, string serviceName, string backendId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(backendId),backendId); + await eventListener.AssertMinimumLength(nameof(backendId),backendId,1); + await eventListener.AssertMaximumLength(nameof(backendId),backendId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Updates an existing backend. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendUpdate(string resourceGroupName, string serviceName, string backendId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/backends/" + + global::System.Uri.EscapeDataString(backendId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates an existing backend. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackendUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/backends/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var backendId = _match.Groups["backendId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/backends/" + + backendId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackendUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackendUpdate_Validate(string resourceGroupName, string serviceName, string backendId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(backendId),backendId); + await eventListener.AssertMinimumLength(nameof(backendId),backendId,1); + await eventListener.AssertMaximumLength(nameof(backendId),backendId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates an External Cache to be used in Api Management instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + /// identifier). + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheCreateOrUpdate(string resourceGroupName, string serviceName, string cacheId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/caches/" + + global::System.Uri.EscapeDataString(cacheId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates an External Cache to be used in Api Management instance. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/caches/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var cacheId = _match.Groups["cacheId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/caches/" + + cacheId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + /// identifier). + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string cacheId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(cacheId),cacheId); + await eventListener.AssertMinimumLength(nameof(cacheId),cacheId,1); + await eventListener.AssertMaximumLength(nameof(cacheId),cacheId,80); + await eventListener.AssertRegEx(nameof(cacheId),cacheId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific Cache. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + /// identifier). + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheDelete(string resourceGroupName, string serviceName, string cacheId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/caches/" + + global::System.Uri.EscapeDataString(cacheId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific Cache. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/caches/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var cacheId = _match.Groups["cacheId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/caches/" + + cacheId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + /// identifier). + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheDelete_Validate(string resourceGroupName, string serviceName, string cacheId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(cacheId),cacheId); + await eventListener.AssertMinimumLength(nameof(cacheId),cacheId,1); + await eventListener.AssertMaximumLength(nameof(cacheId),cacheId,80); + await eventListener.AssertRegEx(nameof(cacheId),cacheId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Cache specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + /// identifier). + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheGet(string resourceGroupName, string serviceName, string cacheId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/caches/" + + global::System.Uri.EscapeDataString(cacheId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the Cache specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + /// identifier). + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheGetEntityTag(string resourceGroupName, string serviceName, string cacheId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/caches/" + + global::System.Uri.EscapeDataString(cacheId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the Cache specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/caches/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var cacheId = _match.Groups["cacheId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/caches/" + + cacheId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + /// identifier). + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheGetEntityTag_Validate(string resourceGroupName, string serviceName, string cacheId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(cacheId),cacheId); + await eventListener.AssertMinimumLength(nameof(cacheId),cacheId,1); + await eventListener.AssertMaximumLength(nameof(cacheId),cacheId,80); + await eventListener.AssertRegEx(nameof(cacheId),cacheId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Cache specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/caches/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var cacheId = _match.Groups["cacheId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/caches/" + + cacheId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + /// identifier). + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheGet_Validate(string resourceGroupName, string serviceName, string cacheId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(cacheId),cacheId); + await eventListener.AssertMinimumLength(nameof(cacheId),cacheId,1); + await eventListener.AssertMaximumLength(nameof(cacheId),cacheId,80); + await eventListener.AssertRegEx(nameof(cacheId),cacheId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of all external Caches in the specified service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheListByService(string resourceGroupName, string serviceName, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/caches" + + "?" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of all external Caches in the specified service instance. + /// + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheListByServiceViaIdentity(global::System.String viaIdentity, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/caches$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/caches" + + "?" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheListByService_Validate(string resourceGroupName, string serviceName, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the cache specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + /// identifier). + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheUpdate(string resourceGroupName, string serviceName, string cacheId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/caches/" + + global::System.Uri.EscapeDataString(cacheId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the cache specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CacheUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/caches/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var cacheId = _match.Groups["cacheId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/caches/" + + cacheId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CacheUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + /// identifier). + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CacheUpdate_Validate(string resourceGroupName, string serviceName, string cacheId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(cacheId),cacheId); + await eventListener.AssertMinimumLength(nameof(cacheId),cacheId,1); + await eventListener.AssertMaximumLength(nameof(cacheId),cacheId,80); + await eventListener.AssertRegEx(nameof(cacheId),cacheId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Creates or updates the certificate being used for authentication with the backend. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateCreateOrUpdate(string resourceGroupName, string serviceName, string certificateId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/certificates/" + + global::System.Uri.EscapeDataString(certificateId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Creates or updates the certificate being used for authentication with the backend. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/certificates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var certificateId = _match.Groups["certificateId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/certificates/" + + certificateId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string certificateId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(certificateId),certificateId); + await eventListener.AssertMinimumLength(nameof(certificateId),certificateId,1); + await eventListener.AssertMaximumLength(nameof(certificateId),certificateId,80); + await eventListener.AssertRegEx(nameof(certificateId),certificateId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific certificate. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateDelete(string resourceGroupName, string serviceName, string certificateId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/certificates/" + + global::System.Uri.EscapeDataString(certificateId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific certificate. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/certificates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var certificateId = _match.Groups["certificateId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/certificates/" + + certificateId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateDelete_Validate(string resourceGroupName, string serviceName, string certificateId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(certificateId),certificateId); + await eventListener.AssertMinimumLength(nameof(certificateId),certificateId,1); + await eventListener.AssertMaximumLength(nameof(certificateId),certificateId,80); + await eventListener.AssertRegEx(nameof(certificateId),certificateId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the certificate specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateGet(string resourceGroupName, string serviceName, string certificateId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/certificates/" + + global::System.Uri.EscapeDataString(certificateId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the certificate specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateGetEntityTag(string resourceGroupName, string serviceName, string certificateId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/certificates/" + + global::System.Uri.EscapeDataString(certificateId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the certificate specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/certificates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var certificateId = _match.Groups["certificateId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/certificates/" + + certificateId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateGetEntityTag_Validate(string resourceGroupName, string serviceName, string certificateId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(certificateId),certificateId); + await eventListener.AssertMinimumLength(nameof(certificateId),certificateId,1); + await eventListener.AssertMaximumLength(nameof(certificateId),certificateId,80); + await eventListener.AssertRegEx(nameof(certificateId),certificateId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the certificate specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/certificates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var certificateId = _match.Groups["certificateId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/certificates/" + + certificateId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateGet_Validate(string resourceGroupName, string serviceName, string certificateId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(certificateId),certificateId); + await eventListener.AssertMinimumLength(nameof(certificateId),certificateId,1); + await eventListener.AssertMaximumLength(nameof(certificateId),certificateId,80); + await eventListener.AssertRegEx(nameof(certificateId),certificateId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of all certificates in the specified service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| subject | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| thumbprint | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| expirationDate | filter | ge, le, eq, ne, gt, lt | |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains only certificates entities which failed + /// refresh. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? isKeyVaultRefreshFailed, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/certificates" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == isKeyVaultRefreshFailed ? global::System.String.Empty : "isKeyVaultRefreshFailed=" + global::System.Uri.EscapeDataString(isKeyVaultRefreshFailed.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of all certificates in the specified service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| subject | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| thumbprint | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| expirationDate | filter | ge, le, eq, ne, gt, lt | |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains only certificates entities which failed + /// refresh. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, bool? isKeyVaultRefreshFailed, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/certificates$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/certificates" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == isKeyVaultRefreshFailed ? global::System.String.Empty : "isKeyVaultRefreshFailed=" + global::System.Uri.EscapeDataString(isKeyVaultRefreshFailed.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| subject | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| thumbprint | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| expirationDate | filter | ge, le, eq, ne, gt, lt | |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains only certificates entities which failed + /// refresh. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? isKeyVaultRefreshFailed, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// From KeyVault, Refresh the certificate being used for authentication with the backend. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateRefreshSecret(string resourceGroupName, string serviceName, string certificateId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/certificates/" + + global::System.Uri.EscapeDataString(certificateId) + + "/refreshSecret" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateRefreshSecret_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// From KeyVault, Refresh the certificate being used for authentication with the backend. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CertificateRefreshSecretViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/certificates/(?[^/]+)/refreshSecret$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}/refreshSecret'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var certificateId = _match.Groups["certificateId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/certificates/" + + certificateId + + "/refreshSecret" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CertificateRefreshSecret_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateRefreshSecret_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CertificateRefreshSecret_Validate(string resourceGroupName, string serviceName, string certificateId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(certificateId),certificateId); + await eventListener.AssertMinimumLength(nameof(certificateId),certificateId,1); + await eventListener.AssertMaximumLength(nameof(certificateId),certificateId,80); + await eventListener.AssertRegEx(nameof(certificateId),certificateId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Creates a new developer portal's content item specified by the provided content type. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// Content item identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentItemCreateOrUpdate(string resourceGroupName, string serviceName, string contentTypeId, string contentItemId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/contentTypes/" + + global::System.Uri.EscapeDataString(contentTypeId) + + "/contentItems/" + + global::System.Uri.EscapeDataString(contentItemId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentItemCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Creates a new developer portal's content item specified by the provided content type. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentItemCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/contentTypes/(?[^/]+)/contentItems/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var contentTypeId = _match.Groups["contentTypeId"].Value; + var contentItemId = _match.Groups["contentItemId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/contentTypes/" + + contentTypeId + + "/contentItems/" + + contentItemId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentItemCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentItemCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentItemContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentItemContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// Content item identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentItemCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string contentTypeId, string contentItemId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(contentTypeId),contentTypeId); + await eventListener.AssertMinimumLength(nameof(contentTypeId),contentTypeId,1); + await eventListener.AssertMaximumLength(nameof(contentTypeId),contentTypeId,80); + await eventListener.AssertNotNull(nameof(contentItemId),contentItemId); + await eventListener.AssertMinimumLength(nameof(contentItemId),contentItemId,1); + await eventListener.AssertMaximumLength(nameof(contentItemId),contentItemId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Removes the specified developer portal's content item. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// Content item identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentItemDelete(string resourceGroupName, string serviceName, string contentTypeId, string contentItemId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/contentTypes/" + + global::System.Uri.EscapeDataString(contentTypeId) + + "/contentItems/" + + global::System.Uri.EscapeDataString(contentItemId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentItemDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Removes the specified developer portal's content item. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentItemDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/contentTypes/(?[^/]+)/contentItems/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var contentTypeId = _match.Groups["contentTypeId"].Value; + var contentItemId = _match.Groups["contentItemId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/contentTypes/" + + contentTypeId + + "/contentItems/" + + contentItemId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentItemDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentItemDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// Content item identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentItemDelete_Validate(string resourceGroupName, string serviceName, string contentTypeId, string contentItemId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(contentTypeId),contentTypeId); + await eventListener.AssertMinimumLength(nameof(contentTypeId),contentTypeId,1); + await eventListener.AssertMaximumLength(nameof(contentTypeId),contentTypeId,80); + await eventListener.AssertNotNull(nameof(contentItemId),contentItemId); + await eventListener.AssertMinimumLength(nameof(contentItemId),contentItemId,1); + await eventListener.AssertMaximumLength(nameof(contentItemId),contentItemId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Returns the developer portal's content item specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// Content item identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentItemGet(string resourceGroupName, string serviceName, string contentTypeId, string contentItemId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/contentTypes/" + + global::System.Uri.EscapeDataString(contentTypeId) + + "/contentItems/" + + global::System.Uri.EscapeDataString(contentItemId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentItemGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Returns the entity state (ETag) version of the developer portal's content item specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// Content item identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentItemGetEntityTag(string resourceGroupName, string serviceName, string contentTypeId, string contentItemId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/contentTypes/" + + global::System.Uri.EscapeDataString(contentTypeId) + + "/contentItems/" + + global::System.Uri.EscapeDataString(contentItemId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentItemGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Returns the entity state (ETag) version of the developer portal's content item specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentItemGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/contentTypes/(?[^/]+)/contentItems/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var contentTypeId = _match.Groups["contentTypeId"].Value; + var contentItemId = _match.Groups["contentItemId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/contentTypes/" + + contentTypeId + + "/contentItems/" + + contentItemId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentItemGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentItemGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// Content item identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentItemGetEntityTag_Validate(string resourceGroupName, string serviceName, string contentTypeId, string contentItemId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(contentTypeId),contentTypeId); + await eventListener.AssertMinimumLength(nameof(contentTypeId),contentTypeId,1); + await eventListener.AssertMaximumLength(nameof(contentTypeId),contentTypeId,80); + await eventListener.AssertNotNull(nameof(contentItemId),contentItemId); + await eventListener.AssertMinimumLength(nameof(contentItemId),contentItemId,1); + await eventListener.AssertMaximumLength(nameof(contentItemId),contentItemId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Returns the developer portal's content item specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentItemGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/contentTypes/(?[^/]+)/contentItems/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var contentTypeId = _match.Groups["contentTypeId"].Value; + var contentItemId = _match.Groups["contentItemId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/contentTypes/" + + contentTypeId + + "/contentItems/" + + contentItemId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentItemGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentItemGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentItemContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// Content item identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentItemGet_Validate(string resourceGroupName, string serviceName, string contentTypeId, string contentItemId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(contentTypeId),contentTypeId); + await eventListener.AssertMinimumLength(nameof(contentTypeId),contentTypeId,1); + await eventListener.AssertMaximumLength(nameof(contentTypeId),contentTypeId,80); + await eventListener.AssertNotNull(nameof(contentItemId),contentItemId); + await eventListener.AssertMinimumLength(nameof(contentItemId),contentItemId,1); + await eventListener.AssertMaximumLength(nameof(contentItemId),contentItemId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists developer portal's content items specified by the provided content type. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentItemListByService(string resourceGroupName, string serviceName, string contentTypeId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/contentTypes/" + + global::System.Uri.EscapeDataString(contentTypeId) + + "/contentItems" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentItemListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists developer portal's content items specified by the provided content type. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentItemListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/contentTypes/(?[^/]+)/contentItems$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var contentTypeId = _match.Groups["contentTypeId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/contentTypes/" + + contentTypeId + + "/contentItems" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentItemListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentItemListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentItemCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentItemListByService_Validate(string resourceGroupName, string serviceName, string contentTypeId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(contentTypeId),contentTypeId); + await eventListener.AssertMinimumLength(nameof(contentTypeId),contentTypeId,1); + await eventListener.AssertMaximumLength(nameof(contentTypeId),contentTypeId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Creates or updates the developer portal's content type. Content types describe content items' properties, validation rules, + /// and constraints. Custom content types' identifiers need to start with the `c-` prefix. Built-in content types can't be + /// modified. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentTypeCreateOrUpdate(string resourceGroupName, string serviceName, string contentTypeId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/contentTypes/" + + global::System.Uri.EscapeDataString(contentTypeId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentTypeCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Creates or updates the developer portal's content type. Content types describe content items' properties, validation rules, + /// and constraints. Custom content types' identifiers need to start with the `c-` prefix. Built-in content types can't be + /// modified. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentTypeCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/contentTypes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var contentTypeId = _match.Groups["contentTypeId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/contentTypes/" + + contentTypeId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentTypeCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentTypeCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentTypeContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentTypeContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentTypeCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string contentTypeId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(contentTypeId),contentTypeId); + await eventListener.AssertMinimumLength(nameof(contentTypeId),contentTypeId,1); + await eventListener.AssertMaximumLength(nameof(contentTypeId),contentTypeId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Removes the specified developer portal's content type. Content types describe content items' properties, validation rules, + /// and constraints. Built-in content types (with identifiers starting with the `c-` prefix) can't be removed. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentTypeDelete(string resourceGroupName, string serviceName, string contentTypeId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/contentTypes/" + + global::System.Uri.EscapeDataString(contentTypeId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentTypeDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Removes the specified developer portal's content type. Content types describe content items' properties, validation rules, + /// and constraints. Built-in content types (with identifiers starting with the `c-` prefix) can't be removed. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentTypeDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/contentTypes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var contentTypeId = _match.Groups["contentTypeId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/contentTypes/" + + contentTypeId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentTypeDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentTypeDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentTypeDelete_Validate(string resourceGroupName, string serviceName, string contentTypeId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(contentTypeId),contentTypeId); + await eventListener.AssertMinimumLength(nameof(contentTypeId),contentTypeId,1); + await eventListener.AssertMaximumLength(nameof(contentTypeId),contentTypeId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the details of the developer portal's content type. Content types describe content items' properties, validation + /// rules, and constraints. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentTypeGet(string resourceGroupName, string serviceName, string contentTypeId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/contentTypes/" + + global::System.Uri.EscapeDataString(contentTypeId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentTypeGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the details of the developer portal's content type. Content types describe content items' properties, validation + /// rules, and constraints. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentTypeGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/contentTypes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var contentTypeId = _match.Groups["contentTypeId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/contentTypes/" + + contentTypeId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentTypeGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentTypeGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentTypeContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Content type identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentTypeGet_Validate(string resourceGroupName, string serviceName, string contentTypeId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(contentTypeId),contentTypeId); + await eventListener.AssertMinimumLength(nameof(contentTypeId),contentTypeId,1); + await eventListener.AssertMaximumLength(nameof(contentTypeId),contentTypeId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists the developer portal's content types. Content types describe content items' properties, validation rules, and constraints. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentTypeListByService(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/contentTypes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentTypeListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists the developer portal's content types. Content types describe content items' properties, validation rules, and constraints. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ContentTypeListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/contentTypes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/contentTypes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContentTypeListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentTypeListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentTypeCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ContentTypeListByService_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Create or Update Delegation settings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DelegationSettingsCreateOrUpdate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/delegation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DelegationSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or Update Delegation settings. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DelegationSettingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/delegation$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/delegation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DelegationSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DelegationSettingsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalDelegationSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DelegationSettingsCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettings body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get Delegation Settings for the Portal. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DelegationSettingsGet(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/delegation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DelegationSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the DelegationSettings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DelegationSettingsGetEntityTag(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/delegation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DelegationSettingsGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the DelegationSettings. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DelegationSettingsGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/delegation$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/delegation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DelegationSettingsGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DelegationSettingsGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DelegationSettingsGetEntityTag_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get Delegation Settings for the Portal. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DelegationSettingsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/delegation$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/delegation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DelegationSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DelegationSettingsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalDelegationSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DelegationSettingsGet_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the secret validation key of the DelegationSettings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DelegationSettingsListSecrets(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/delegation/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DelegationSettingsListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the secret validation key of the DelegationSettings. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DelegationSettingsListSecretsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/delegation/listSecrets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation/listSecrets'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/delegation/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DelegationSettingsListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DelegationSettingsListSecrets_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSettingValidationKeyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DelegationSettingsListSecrets_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Update Delegation settings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update Delegation settings. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DelegationSettingsUpdate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettings body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/delegation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DelegationSettingsUpdate_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Update Delegation settings. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update Delegation settings. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DelegationSettingsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettings body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/delegation$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/delegation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DelegationSettingsUpdate_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DelegationSettingsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update Delegation settings. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DelegationSettingsUpdate_Validate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettings body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get soft-deleted Api Management Service by name. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The location of the deleted API Management service. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DeletedServicesGetByName(string serviceName, string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ApiManagement/locations/" + + global::System.Uri.EscapeDataString(location) + + "/deletedservices/" + + global::System.Uri.EscapeDataString(serviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeletedServicesGetByName_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get soft-deleted Api Management Service by name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DeletedServicesGetByNameViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.ApiManagement/locations/(?[^/]+)/deletedservices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'"); + } + + // replace URI parameters with values from identity + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ApiManagement/locations/" + + location + + "/deletedservices/" + + serviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeletedServicesGetByName_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DeletedServicesGetByName_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DeletedServiceContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The location of the deleted API Management service. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DeletedServicesGetByName_Validate(string serviceName, string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(location),location); + } + } + + /// + /// Lists all soft-deleted services available for undelete for the given subscription. + /// + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DeletedServicesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ApiManagement/deletedservices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeletedServicesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all soft-deleted services available for undelete for the given subscription. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DeletedServicesListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.ApiManagement/deletedservices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ApiManagement/deletedservices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeletedServicesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DeletedServicesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DeletedServicesCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DeletedServicesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Purges Api Management Service (deletes it with no option to undelete). + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The location of the deleted API Management service. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DeletedServicesPurge(string serviceName, string subscriptionId, string location, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ApiManagement/locations/" + + global::System.Uri.EscapeDataString(location) + + "/deletedservices/" + + global::System.Uri.EscapeDataString(serviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeletedServicesPurge_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Purges Api Management Service (deletes it with no option to undelete). + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DeletedServicesPurgeViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.ApiManagement/locations/(?[^/]+)/deletedservices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'"); + } + + // replace URI parameters with values from identity + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ApiManagement/locations/" + + location + + "/deletedservices/" + + serviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeletedServicesPurge_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DeletedServicesPurge_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The location of the deleted API Management service. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DeletedServicesPurge_Validate(string serviceName, string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(location),location); + } + } + + /// Creates a new Diagnostic or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticCreateOrUpdate(string resourceGroupName, string serviceName, string diagnosticId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/diagnostics/" + + global::System.Uri.EscapeDataString(diagnosticId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new Diagnostic or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/diagnostics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var diagnosticId = _match.Groups["diagnosticId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/diagnostics/" + + diagnosticId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string diagnosticId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(diagnosticId),diagnosticId); + await eventListener.AssertMinimumLength(nameof(diagnosticId),diagnosticId,1); + await eventListener.AssertMaximumLength(nameof(diagnosticId),diagnosticId,80); + await eventListener.AssertRegEx(nameof(diagnosticId),diagnosticId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified Diagnostic. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticDelete(string resourceGroupName, string serviceName, string diagnosticId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/diagnostics/" + + global::System.Uri.EscapeDataString(diagnosticId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified Diagnostic. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/diagnostics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var diagnosticId = _match.Groups["diagnosticId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/diagnostics/" + + diagnosticId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticDelete_Validate(string resourceGroupName, string serviceName, string diagnosticId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(diagnosticId),diagnosticId); + await eventListener.AssertMinimumLength(nameof(diagnosticId),diagnosticId,1); + await eventListener.AssertMaximumLength(nameof(diagnosticId),diagnosticId,80); + await eventListener.AssertRegEx(nameof(diagnosticId),diagnosticId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Diagnostic specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticGet(string resourceGroupName, string serviceName, string diagnosticId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/diagnostics/" + + global::System.Uri.EscapeDataString(diagnosticId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticGetEntityTag(string resourceGroupName, string serviceName, string diagnosticId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/diagnostics/" + + global::System.Uri.EscapeDataString(diagnosticId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/diagnostics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var diagnosticId = _match.Groups["diagnosticId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/diagnostics/" + + diagnosticId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticGetEntityTag_Validate(string resourceGroupName, string serviceName, string diagnosticId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(diagnosticId),diagnosticId); + await eventListener.AssertMinimumLength(nameof(diagnosticId),diagnosticId,1); + await eventListener.AssertMaximumLength(nameof(diagnosticId),diagnosticId,80); + await eventListener.AssertRegEx(nameof(diagnosticId),diagnosticId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Diagnostic specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/diagnostics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var diagnosticId = _match.Groups["diagnosticId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/diagnostics/" + + diagnosticId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticGet_Validate(string resourceGroupName, string serviceName, string diagnosticId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(diagnosticId),diagnosticId); + await eventListener.AssertMinimumLength(nameof(diagnosticId),diagnosticId,1); + await eventListener.AssertMaximumLength(nameof(diagnosticId),diagnosticId,80); + await eventListener.AssertRegEx(nameof(diagnosticId),diagnosticId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all diagnostics of the API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/diagnostics" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all diagnostics of the API Management service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/diagnostics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/diagnostics" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the Diagnostic specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Diagnostic Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticUpdate(string resourceGroupName, string serviceName, string diagnosticId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/diagnostics/" + + global::System.Uri.EscapeDataString(diagnosticId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the Diagnostic specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Diagnostic Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DiagnosticUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/diagnostics/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var diagnosticId = _match.Groups["diagnosticId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/diagnostics/" + + diagnosticId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Diagnostic Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticUpdate_Validate(string resourceGroupName, string serviceName, string diagnosticId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(diagnosticId),diagnosticId); + await eventListener.AssertMinimumLength(nameof(diagnosticId),diagnosticId,1); + await eventListener.AssertMaximumLength(nameof(diagnosticId),diagnosticId,80); + await eventListener.AssertRegEx(nameof(diagnosticId),diagnosticId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates a new Documentation or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Documentation identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationCreateOrUpdate(string resourceGroupName, string serviceName, string documentationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/documentations/" + + global::System.Uri.EscapeDataString(documentationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new Documentation or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/documentations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var documentationId = _match.Groups["documentationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/documentations/" + + documentationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Documentation identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string documentationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(documentationId),documentationId); + await eventListener.AssertMinimumLength(nameof(documentationId),documentationId,1); + await eventListener.AssertMaximumLength(nameof(documentationId),documentationId,256); + await eventListener.AssertRegEx(nameof(documentationId),documentationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified Documentation from an API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Documentation identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationDelete(string resourceGroupName, string serviceName, string documentationId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/documentations/" + + global::System.Uri.EscapeDataString(documentationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified Documentation from an API. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/documentations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var documentationId = _match.Groups["documentationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/documentations/" + + documentationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Documentation identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationDelete_Validate(string resourceGroupName, string serviceName, string documentationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(documentationId),documentationId); + await eventListener.AssertMinimumLength(nameof(documentationId),documentationId,1); + await eventListener.AssertMaximumLength(nameof(documentationId),documentationId,256); + await eventListener.AssertRegEx(nameof(documentationId),documentationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Documentation specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Documentation identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationGet(string resourceGroupName, string serviceName, string documentationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/documentations/" + + global::System.Uri.EscapeDataString(documentationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the Documentation by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Documentation identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationGetEntityTag(string resourceGroupName, string serviceName, string documentationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/documentations/" + + global::System.Uri.EscapeDataString(documentationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the Documentation by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/documentations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var documentationId = _match.Groups["documentationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/documentations/" + + documentationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Documentation identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationGetEntityTag_Validate(string resourceGroupName, string serviceName, string documentationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(documentationId),documentationId); + await eventListener.AssertMinimumLength(nameof(documentationId),documentationId,1); + await eventListener.AssertMaximumLength(nameof(documentationId),documentationId,256); + await eventListener.AssertRegEx(nameof(documentationId),documentationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Documentation specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/documentations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var documentationId = _match.Groups["documentationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/documentations/" + + documentationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Documentation identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationGet_Validate(string resourceGroupName, string serviceName, string documentationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(documentationId),documentationId); + await eventListener.AssertMinimumLength(nameof(documentationId),documentationId,1); + await eventListener.AssertMaximumLength(nameof(documentationId),documentationId,256); + await eventListener.AssertRegEx(nameof(documentationId),documentationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all Documentations of the API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq | contains |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/documentations" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all Documentations of the API Management service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq | contains |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/documentations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/documentations" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq | contains |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Updates the details of the Documentation for an API specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Documentation identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Documentation Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationUpdate(string resourceGroupName, string serviceName, string documentationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/documentations/" + + global::System.Uri.EscapeDataString(documentationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Updates the details of the Documentation for an API specified by its identifier. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Documentation Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DocumentationUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/documentations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var documentationId = _match.Groups["documentationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/documentations/" + + documentationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DocumentationUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Documentation identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Documentation Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DocumentationUpdate_Validate(string resourceGroupName, string serviceName, string documentationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(documentationId),documentationId); + await eventListener.AssertMinimumLength(nameof(documentationId),documentationId,1); + await eventListener.AssertMaximumLength(nameof(documentationId),documentationId,256); + await eventListener.AssertRegEx(nameof(documentationId),documentationId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Updates an Email Template. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Email Template Name Identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Email Template update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateCreateOrUpdate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName templateName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/templates/" + + global::System.Uri.EscapeDataString(templateName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Updates an Email Template. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Email Template update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/templates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var templateName = _match.Groups["templateName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/templates/" + + templateName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Email Template Name Identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Email Template update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateCreateOrUpdate_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName templateName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(templateName),templateName); + await eventListener.AssertEnum(nameof(templateName),templateName,@"applicationApprovedNotificationMessage", @"accountClosedDeveloper", @"quotaLimitApproachingDeveloperNotificationMessage", @"newDeveloperNotificationMessage", @"emailChangeIdentityDefault", @"inviteUserNotificationMessage", @"newCommentNotificationMessage", @"confirmSignUpIdentityDefault", @"newIssueNotificationMessage", @"purchaseDeveloperNotificationMessage", @"passwordResetIdentityDefault", @"passwordResetByAdminNotificationMessage", @"rejectDeveloperNotificationMessage", @"requestDeveloperNotificationMessage"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Reset the Email Template to default template provided by the API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Email Template Name Identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateDelete(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName templateName, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/templates/" + + global::System.Uri.EscapeDataString(templateName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Reset the Email Template to default template provided by the API Management service instance. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/templates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var templateName = _match.Groups["templateName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/templates/" + + templateName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Email Template Name Identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateDelete_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName templateName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(templateName),templateName); + await eventListener.AssertEnum(nameof(templateName),templateName,@"applicationApprovedNotificationMessage", @"accountClosedDeveloper", @"quotaLimitApproachingDeveloperNotificationMessage", @"newDeveloperNotificationMessage", @"emailChangeIdentityDefault", @"inviteUserNotificationMessage", @"newCommentNotificationMessage", @"confirmSignUpIdentityDefault", @"newIssueNotificationMessage", @"purchaseDeveloperNotificationMessage", @"passwordResetIdentityDefault", @"passwordResetByAdminNotificationMessage", @"rejectDeveloperNotificationMessage", @"requestDeveloperNotificationMessage"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the email template specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Email Template Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateGet(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName templateName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/templates/" + + global::System.Uri.EscapeDataString(templateName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the email template specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Email Template Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateGetEntityTag(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName templateName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/templates/" + + global::System.Uri.EscapeDataString(templateName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the email template specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/templates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var templateName = _match.Groups["templateName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/templates/" + + templateName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Email Template Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateGetEntityTag_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName templateName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(templateName),templateName); + await eventListener.AssertEnum(nameof(templateName),templateName,@"applicationApprovedNotificationMessage", @"accountClosedDeveloper", @"quotaLimitApproachingDeveloperNotificationMessage", @"newDeveloperNotificationMessage", @"emailChangeIdentityDefault", @"inviteUserNotificationMessage", @"newCommentNotificationMessage", @"confirmSignUpIdentityDefault", @"newIssueNotificationMessage", @"purchaseDeveloperNotificationMessage", @"passwordResetIdentityDefault", @"passwordResetByAdminNotificationMessage", @"rejectDeveloperNotificationMessage", @"requestDeveloperNotificationMessage"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the email template specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/templates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var templateName = _match.Groups["templateName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/templates/" + + templateName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Email Template Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateGet_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName templateName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(templateName),templateName); + await eventListener.AssertEnum(nameof(templateName),templateName,@"applicationApprovedNotificationMessage", @"accountClosedDeveloper", @"quotaLimitApproachingDeveloperNotificationMessage", @"newDeveloperNotificationMessage", @"emailChangeIdentityDefault", @"inviteUserNotificationMessage", @"newCommentNotificationMessage", @"confirmSignUpIdentityDefault", @"newIssueNotificationMessage", @"purchaseDeveloperNotificationMessage", @"passwordResetIdentityDefault", @"passwordResetByAdminNotificationMessage", @"rejectDeveloperNotificationMessage", @"requestDeveloperNotificationMessage"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets all email templates + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/templates" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all email templates + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/templates$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/templates" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates API Management email template + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Email Template Name Identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateUpdate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName templateName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/templates/" + + global::System.Uri.EscapeDataString(templateName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates API Management email template + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EmailTemplateUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/templates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var templateName = _match.Groups["templateName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/templates/" + + templateName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EmailTemplateUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Email Template Name Identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EmailTemplateUpdate_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName templateName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(templateName),templateName); + await eventListener.AssertEnum(nameof(templateName),templateName,@"applicationApprovedNotificationMessage", @"accountClosedDeveloper", @"quotaLimitApproachingDeveloperNotificationMessage", @"newDeveloperNotificationMessage", @"emailChangeIdentityDefault", @"inviteUserNotificationMessage", @"newCommentNotificationMessage", @"confirmSignUpIdentityDefault", @"newIssueNotificationMessage", @"purchaseDeveloperNotificationMessage", @"passwordResetIdentityDefault", @"passwordResetByAdminNotificationMessage", @"rejectDeveloperNotificationMessage", @"requestDeveloperNotificationMessage"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Adds an API to the specified Gateway. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// API identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Association entity details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayApiCreateOrUpdate(string resourceGroupName, string serviceName, string gatewayId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayApiCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds an API to the specified Gateway. + /// + /// Association entity details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayApiCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayApiCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayApiCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// API identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Association entity details. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayApiCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string gatewayId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified API from the specified Gateway. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// API identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayApiDelete(string resourceGroupName, string serviceName, string gatewayId, string apiId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayApiDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified API from the specified Gateway. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayApiDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayApiDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayApiDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// API identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayApiDelete_Validate(string resourceGroupName, string serviceName, string gatewayId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Checks that API entity specified by identifier is associated with the Gateway entity. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// API identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayApiGetEntityTag(string resourceGroupName, string serviceName, string gatewayId, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayApiGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Checks that API entity specified by identifier is associated with the Gateway entity. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayApiGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayApiGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayApiGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// API identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayApiGetEntityTag_Validate(string resourceGroupName, string serviceName, string gatewayId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the APIs associated with a gateway. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayApiListByService(string resourceGroupName, string serviceName, string gatewayId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/apis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayApiListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the APIs associated with a gateway. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayApiListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/apis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/apis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayApiListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayApiListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayApiListByService_Validate(string resourceGroupName, string serviceName, string gatewayId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Assign Certificate entity to Gateway entity as Certificate Authority. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Gateway certificate authority details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCertificateAuthorityCreateOrUpdate(string resourceGroupName, string serviceName, string gatewayId, string certificateId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/certificateAuthorities/" + + global::System.Uri.EscapeDataString(certificateId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCertificateAuthorityCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Assign Certificate entity to Gateway entity as Certificate Authority. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Gateway certificate authority details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCertificateAuthorityCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/certificateAuthorities/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var certificateId = _match.Groups["certificateId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/certificateAuthorities/" + + certificateId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCertificateAuthorityCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCertificateAuthorityCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayCertificateAuthorityContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayCertificateAuthorityContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Gateway certificate authority details. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCertificateAuthorityCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string gatewayId, string certificateId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(certificateId),certificateId); + await eventListener.AssertMinimumLength(nameof(certificateId),certificateId,1); + await eventListener.AssertMaximumLength(nameof(certificateId),certificateId,80); + await eventListener.AssertRegEx(nameof(certificateId),certificateId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Remove relationship between Certificate Authority and Gateway entity. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCertificateAuthorityDelete(string resourceGroupName, string serviceName, string gatewayId, string certificateId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/certificateAuthorities/" + + global::System.Uri.EscapeDataString(certificateId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCertificateAuthorityDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Remove relationship between Certificate Authority and Gateway entity. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCertificateAuthorityDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/certificateAuthorities/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var certificateId = _match.Groups["certificateId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/certificateAuthorities/" + + certificateId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCertificateAuthorityDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCertificateAuthorityDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCertificateAuthorityDelete_Validate(string resourceGroupName, string serviceName, string gatewayId, string certificateId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(certificateId),certificateId); + await eventListener.AssertMinimumLength(nameof(certificateId),certificateId,1); + await eventListener.AssertMaximumLength(nameof(certificateId),certificateId,80); + await eventListener.AssertRegEx(nameof(certificateId),certificateId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get assigned Gateway Certificate Authority details. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCertificateAuthorityGet(string resourceGroupName, string serviceName, string gatewayId, string certificateId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/certificateAuthorities/" + + global::System.Uri.EscapeDataString(certificateId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCertificateAuthorityGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCertificateAuthorityGetEntityTag(string resourceGroupName, string serviceName, string gatewayId, string certificateId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/certificateAuthorities/" + + global::System.Uri.EscapeDataString(certificateId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCertificateAuthorityGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCertificateAuthorityGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/certificateAuthorities/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var certificateId = _match.Groups["certificateId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/certificateAuthorities/" + + certificateId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCertificateAuthorityGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCertificateAuthorityGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCertificateAuthorityGetEntityTag_Validate(string resourceGroupName, string serviceName, string gatewayId, string certificateId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(certificateId),certificateId); + await eventListener.AssertMinimumLength(nameof(certificateId),certificateId,1); + await eventListener.AssertMaximumLength(nameof(certificateId),certificateId,80); + await eventListener.AssertRegEx(nameof(certificateId),certificateId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get assigned Gateway Certificate Authority details. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCertificateAuthorityGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/certificateAuthorities/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var certificateId = _match.Groups["certificateId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/certificateAuthorities/" + + certificateId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCertificateAuthorityGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCertificateAuthorityGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayCertificateAuthorityContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Identifier of the certificate entity. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCertificateAuthorityGet_Validate(string resourceGroupName, string serviceName, string gatewayId, string certificateId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(certificateId),certificateId); + await eventListener.AssertMinimumLength(nameof(certificateId),certificateId,1); + await eventListener.AssertMaximumLength(nameof(certificateId),certificateId,80); + await eventListener.AssertRegEx(nameof(certificateId),certificateId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists the collection of Certificate Authorities for the specified Gateway entity. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq, ne | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCertificateAuthorityListByService(string resourceGroupName, string serviceName, string gatewayId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/certificateAuthorities" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCertificateAuthorityListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists the collection of Certificate Authorities for the specified Gateway entity. + /// + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq, ne | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCertificateAuthorityListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/certificateAuthorities$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/certificateAuthorities" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCertificateAuthorityListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCertificateAuthorityListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayCertificateAuthorityCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq, ne | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCertificateAuthorityListByService_Validate(string resourceGroupName, string serviceName, string gatewayId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates a Gateway to be used in Api Management instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Gateway details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCreateOrUpdate(string resourceGroupName, string serviceName, string gatewayId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates a Gateway to be used in Api Management instance. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Gateway details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Gateway details. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string gatewayId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific Gateway. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayDelete(string resourceGroupName, string serviceName, string gatewayId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific Gateway. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayDelete_Validate(string resourceGroupName, string serviceName, string gatewayId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the Shared Access Authorization Token for the gateway. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// The ID of the target subscription. The value must be an UUID. + /// Gateway token request contract properties. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayGenerateToken(string resourceGroupName, string serviceName, string gatewayId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenRequestContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/generateToken" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayGenerateToken_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the Shared Access Authorization Token for the gateway. + /// + /// Gateway token request contract properties. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayGenerateTokenViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenRequestContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/generateToken$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/generateToken'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/generateToken" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayGenerateToken_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayGenerateToken_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayTokenContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// The ID of the target subscription. The value must be an UUID. + /// Gateway token request contract properties. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayGenerateToken_Validate(string resourceGroupName, string serviceName, string gatewayId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenRequestContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets the details of the Gateway specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayGet(string resourceGroupName, string serviceName, string gatewayId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Gateway specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayGetEntityTag(string resourceGroupName, string serviceName, string gatewayId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Gateway specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayGetEntityTag_Validate(string resourceGroupName, string serviceName, string gatewayId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Gateway specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayGet_Validate(string resourceGroupName, string serviceName, string gatewayId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates of updates hostname configuration for a Gateway. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Gateway hostname configuration details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayHostnameConfigurationCreateOrUpdate(string resourceGroupName, string serviceName, string gatewayId, string hcId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/hostnameConfigurations/" + + global::System.Uri.EscapeDataString(hcId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayHostnameConfigurationCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates of updates hostname configuration for a Gateway. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Gateway hostname configuration details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayHostnameConfigurationCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/hostnameConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var hcId = _match.Groups["hcId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/hostnameConfigurations/" + + hcId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayHostnameConfigurationCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayHostnameConfigurationCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayHostnameConfigurationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayHostnameConfigurationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Gateway hostname configuration details. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayHostnameConfigurationCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string gatewayId, string hcId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(hcId),hcId); + await eventListener.AssertMinimumLength(nameof(hcId),hcId,1); + await eventListener.AssertMaximumLength(nameof(hcId),hcId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified hostname configuration from the specified Gateway. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayHostnameConfigurationDelete(string resourceGroupName, string serviceName, string gatewayId, string hcId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/hostnameConfigurations/" + + global::System.Uri.EscapeDataString(hcId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayHostnameConfigurationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified hostname configuration from the specified Gateway. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayHostnameConfigurationDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/hostnameConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var hcId = _match.Groups["hcId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/hostnameConfigurations/" + + hcId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayHostnameConfigurationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayHostnameConfigurationDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayHostnameConfigurationDelete_Validate(string resourceGroupName, string serviceName, string gatewayId, string hcId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(hcId),hcId); + await eventListener.AssertMinimumLength(nameof(hcId),hcId,1); + await eventListener.AssertMaximumLength(nameof(hcId),hcId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get details of a hostname configuration + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayHostnameConfigurationGet(string resourceGroupName, string serviceName, string gatewayId, string hcId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/hostnameConfigurations/" + + global::System.Uri.EscapeDataString(hcId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayHostnameConfigurationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayHostnameConfigurationGetEntityTag(string resourceGroupName, string serviceName, string gatewayId, string hcId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/hostnameConfigurations/" + + global::System.Uri.EscapeDataString(hcId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayHostnameConfigurationGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayHostnameConfigurationGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/hostnameConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var hcId = _match.Groups["hcId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/hostnameConfigurations/" + + hcId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayHostnameConfigurationGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayHostnameConfigurationGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayHostnameConfigurationGetEntityTag_Validate(string resourceGroupName, string serviceName, string gatewayId, string hcId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(hcId),hcId); + await eventListener.AssertMinimumLength(nameof(hcId),hcId,1); + await eventListener.AssertMaximumLength(nameof(hcId),hcId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get details of a hostname configuration + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayHostnameConfigurationGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/hostnameConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var hcId = _match.Groups["hcId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/hostnameConfigurations/" + + hcId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayHostnameConfigurationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayHostnameConfigurationGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayHostnameConfigurationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayHostnameConfigurationGet_Validate(string resourceGroupName, string serviceName, string gatewayId, string hcId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(hcId),hcId); + await eventListener.AssertMinimumLength(nameof(hcId),hcId,1); + await eventListener.AssertMaximumLength(nameof(hcId),hcId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists the collection of hostname configurations for the specified gateway. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| hostname | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayHostnameConfigurationListByService(string resourceGroupName, string serviceName, string gatewayId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/hostnameConfigurations" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayHostnameConfigurationListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the collection of hostname configurations for the specified gateway. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| hostname | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayHostnameConfigurationListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/hostnameConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/hostnameConfigurations" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayHostnameConfigurationListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayHostnameConfigurationListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayHostnameConfigurationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| hostname | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayHostnameConfigurationListByService_Validate(string resourceGroupName, string serviceName, string gatewayId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Action is invalidating all debug credentials issued for gateway. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayInvalidateDebugCredentials(string subscriptionId, string resourceGroupName, string serviceName, string gatewayId, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/invalidateDebugCredentials" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayInvalidateDebugCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Action is invalidating all debug credentials issued for gateway. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayInvalidateDebugCredentialsViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/invalidateDebugCredentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/invalidateDebugCredentials'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/invalidateDebugCredentials" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayInvalidateDebugCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayInvalidateDebugCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayInvalidateDebugCredentials_Validate(string subscriptionId, string resourceGroupName, string serviceName, string gatewayId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + } + } + + /// Lists a collection of gateways registered with service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| region | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of gateways registered with service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| region | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| region | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Create new debug credentials for gateway. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// List debug credentials properties. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayListDebugCredentials(string subscriptionId, string resourceGroupName, string serviceName, string gatewayId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListDebugCredentialsContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/listDebugCredentials" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayListDebugCredentials_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create new debug credentials for gateway. + /// + /// List debug credentials properties. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayListDebugCredentialsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListDebugCredentialsContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/listDebugCredentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listDebugCredentials'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/listDebugCredentials" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayListDebugCredentials_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayListDebugCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayDebugCredentialsContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// List debug credentials properties. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayListDebugCredentials_Validate(string subscriptionId, string resourceGroupName, string serviceName, string gatewayId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListDebugCredentialsContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Retrieves gateway keys. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayListKeys(string resourceGroupName, string serviceName, string gatewayId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayListKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves gateway keys. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayListKeysViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/listKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listKeys'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayListKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayListKeys_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayKeysContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayListKeys_Validate(string resourceGroupName, string serviceName, string gatewayId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Fetches trace collected by gateway. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// List trace properties. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayListTrace(string subscriptionId, string resourceGroupName, string serviceName, string gatewayId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListTraceContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/listTrace" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayListTrace_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Fetches trace collected by gateway. + /// + /// List trace properties. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayListTraceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListTraceContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/listTrace$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listTrace'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/listTrace" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayListTrace_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayListTrace_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.GatewayTraceContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// List trace properties. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayListTrace_Validate(string subscriptionId, string resourceGroupName, string serviceName, string gatewayId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListTraceContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Regenerates specified gateway key invalidating any tokens created with it. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// The ID of the target subscription. The value must be an UUID. + /// Gateway key regeneration request contract properties. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayRegenerateKey(string resourceGroupName, string serviceName, string gatewayId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeyRegenerationRequestContract body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "/regenerateKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayRegenerateKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Regenerates specified gateway key invalidating any tokens created with it. + /// + /// Gateway key regeneration request contract properties. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayRegenerateKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeyRegenerationRequestContract body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)/regenerateKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/regenerateKey'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "/regenerateKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayRegenerateKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayRegenerateKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// The ID of the target subscription. The value must be an UUID. + /// Gateway key regeneration request contract properties. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayRegenerateKey_Validate(string resourceGroupName, string serviceName, string gatewayId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeyRegenerationRequestContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Updates the details of the gateway specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Gateway details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayUpdate(string resourceGroupName, string serviceName, string gatewayId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the gateway specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Gateway details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GatewayUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/gateways/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/gateways/" + + gatewayId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GatewayUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must + /// not have value 'managed' + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Gateway details. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GatewayUpdate_Validate(string resourceGroupName, string serviceName, string gatewayId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + await eventListener.AssertMinimumLength(nameof(gatewayId),gatewayId,1); + await eventListener.AssertMaximumLength(nameof(gatewayId),gatewayId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Creates new or updates existing specified Schema of the API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GlobalSchemaCreateOrUpdate(string resourceGroupName, string serviceName, string schemaId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GlobalSchemaCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Creates new or updates existing specified Schema of the API Management service instance. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GlobalSchemaCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GlobalSchemaCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GlobalSchemaCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GlobalSchemaContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GlobalSchemaCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string schemaId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific Schema. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GlobalSchemaDelete(string resourceGroupName, string serviceName, string schemaId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GlobalSchemaDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific Schema. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GlobalSchemaDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GlobalSchemaDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GlobalSchemaDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GlobalSchemaDelete_Validate(string resourceGroupName, string serviceName, string schemaId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Schema specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GlobalSchemaGet(string resourceGroupName, string serviceName, string schemaId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GlobalSchemaGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the Schema specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GlobalSchemaGetEntityTag(string resourceGroupName, string serviceName, string schemaId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GlobalSchemaGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the Schema specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GlobalSchemaGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GlobalSchemaGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GlobalSchemaGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GlobalSchemaGetEntityTag_Validate(string resourceGroupName, string serviceName, string schemaId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Schema specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GlobalSchemaGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GlobalSchemaGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GlobalSchemaGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GlobalSchemaContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GlobalSchemaGet_Validate(string resourceGroupName, string serviceName, string schemaId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of schemas registered with service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GlobalSchemaListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/schemas" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GlobalSchemaListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of schemas registered with service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GlobalSchemaListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/schemas$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/schemas" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GlobalSchemaListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GlobalSchemaListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GlobalSchemaCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GlobalSchemaListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a new resolver in the GraphQL API or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string resolverId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers/" + + global::System.Uri.EscapeDataString(resolverId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new resolver in the GraphQL API or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var resolverId = _match.Groups["resolverId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers/" + + resolverId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string resolverId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(resolverId),resolverId); + await eventListener.AssertMinimumLength(nameof(resolverId),resolverId,1); + await eventListener.AssertMaximumLength(nameof(resolverId),resolverId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified resolver in the GraphQL API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverDelete(string resourceGroupName, string serviceName, string apiId, string resolverId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers/" + + global::System.Uri.EscapeDataString(resolverId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified resolver in the GraphQL API. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var resolverId = _match.Groups["resolverId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers/" + + resolverId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverDelete_Validate(string resourceGroupName, string serviceName, string apiId, string resolverId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(resolverId),resolverId); + await eventListener.AssertMinimumLength(nameof(resolverId),resolverId,1); + await eventListener.AssertMaximumLength(nameof(resolverId),resolverId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the GraphQL API Resolver specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverGet(string resourceGroupName, string serviceName, string apiId, string resolverId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers/" + + global::System.Uri.EscapeDataString(resolverId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the GraphQL API resolver specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverGetEntityTag(string resourceGroupName, string serviceName, string apiId, string resolverId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers/" + + global::System.Uri.EscapeDataString(resolverId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the GraphQL API resolver specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var resolverId = _match.Groups["resolverId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers/" + + resolverId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string resolverId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(resolverId),resolverId); + await eventListener.AssertMinimumLength(nameof(resolverId),resolverId,1); + await eventListener.AssertMaximumLength(nameof(resolverId),resolverId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the GraphQL API Resolver specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var resolverId = _match.Groups["resolverId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers/" + + resolverId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverGet_Validate(string resourceGroupName, string serviceName, string apiId, string resolverId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(resolverId),resolverId); + await eventListener.AssertMinimumLength(nameof(resolverId),resolverId,1); + await eventListener.AssertMaximumLength(nameof(resolverId),resolverId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the resolvers for the specified GraphQL API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverListByApi(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the resolvers for the specified GraphQL API. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverListByApiViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverListByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverListByApi_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates policy configuration for the GraphQL API Resolver level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyCreateOrUpdate(string resourceGroupName, string serviceName, string apiId, string resolverId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers/" + + global::System.Uri.EscapeDataString(resolverId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates policy configuration for the GraphQL API Resolver level. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var resolverId = _match.Groups["resolverId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers/" + + resolverId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string resolverId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(resolverId),resolverId); + await eventListener.AssertMinimumLength(nameof(resolverId),resolverId,1); + await eventListener.AssertMaximumLength(nameof(resolverId),resolverId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the policy configuration at the GraphQL Api Resolver. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyDelete(string resourceGroupName, string serviceName, string apiId, string resolverId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers/" + + global::System.Uri.EscapeDataString(resolverId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the policy configuration at the GraphQL Api Resolver. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var resolverId = _match.Groups["resolverId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers/" + + resolverId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyDelete_Validate(string resourceGroupName, string serviceName, string apiId, string resolverId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(resolverId),resolverId); + await eventListener.AssertMinimumLength(nameof(resolverId),resolverId,1); + await eventListener.AssertMaximumLength(nameof(resolverId),resolverId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the GraphQL API Resolver level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyGet(string resourceGroupName, string serviceName, string apiId, string resolverId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers/" + + global::System.Uri.EscapeDataString(resolverId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the GraphQL API resolver policy specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyGetEntityTag(string resourceGroupName, string serviceName, string apiId, string resolverId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers/" + + global::System.Uri.EscapeDataString(resolverId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the GraphQL API resolver policy specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var resolverId = _match.Groups["resolverId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers/" + + resolverId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyGetEntityTag_Validate(string resourceGroupName, string serviceName, string apiId, string resolverId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(resolverId),resolverId); + await eventListener.AssertMinimumLength(nameof(resolverId),resolverId,1); + await eventListener.AssertMaximumLength(nameof(resolverId),resolverId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the GraphQL API Resolver level. + /// + /// Policy Export Format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var resolverId = _match.Groups["resolverId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers/" + + resolverId + + "/policies/" + + policyId + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyGet_Validate(string resourceGroupName, string serviceName, string apiId, string resolverId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(resolverId),resolverId); + await eventListener.AssertMinimumLength(nameof(resolverId),resolverId,1); + await eventListener.AssertMaximumLength(nameof(resolverId),resolverId,80); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the list of policy configuration at the GraphQL API Resolver level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyListByResolver(string resourceGroupName, string serviceName, string apiId, string resolverId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers/" + + global::System.Uri.EscapeDataString(resolverId) + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverPolicyListByResolver_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the list of policy configuration at the GraphQL API Resolver level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyListByResolverViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers/(?[^/]+)/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var resolverId = _match.Groups["resolverId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers/" + + resolverId + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverPolicyListByResolver_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyListByResolver_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverPolicyListByResolver_Validate(string resourceGroupName, string serviceName, string apiId, string resolverId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(resolverId),resolverId); + await eventListener.AssertMinimumLength(nameof(resolverId),resolverId,1); + await eventListener.AssertMaximumLength(nameof(resolverId),resolverId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Updates the details of the resolver in the GraphQL API specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// GraphQL API Resolver Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverUpdate(string resourceGroupName, string serviceName, string apiId, string resolverId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/resolvers/" + + global::System.Uri.EscapeDataString(resolverId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Updates the details of the resolver in the GraphQL API specified by its identifier. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// GraphQL API Resolver Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GraphQlApiResolverUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/resolvers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var resolverId = _match.Groups["resolverId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/resolvers/" + + resolverId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GraphQlApiResolverUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service + /// instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// GraphQL API Resolver Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GraphQlApiResolverUpdate_Validate(string resourceGroupName, string serviceName, string apiId, string resolverId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(resolverId),resolverId); + await eventListener.AssertMinimumLength(nameof(resolverId),resolverId,1); + await eventListener.AssertMaximumLength(nameof(resolverId),resolverId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or Updates a group. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupCreateOrUpdate(string resourceGroupName, string serviceName, string groupId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or Updates a group. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string groupId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific group of the API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupDelete(string resourceGroupName, string serviceName, string groupId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific group of the API Management service instance. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupDelete_Validate(string resourceGroupName, string serviceName, string groupId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the group specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupGet(string resourceGroupName, string serviceName, string groupId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the group specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupGetEntityTag(string resourceGroupName, string serviceName, string groupId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the group specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupGetEntityTag_Validate(string resourceGroupName, string serviceName, string groupId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the group specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupGet_Validate(string resourceGroupName, string serviceName, string groupId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of groups defined within a service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| externalId | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/groups" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of groups defined within a service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| externalId | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/groups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/groups" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| externalId | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the group specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupUpdate(string resourceGroupName, string serviceName, string groupId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the group specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupUpdate_Validate(string resourceGroupName, string serviceName, string groupId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Checks that user entity specified by identifier is associated with the group entity. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupUserCheckEntityExists(string resourceGroupName, string serviceName, string groupId, string userId, string subscriptionId, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupUserCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// + /// Checks that user entity specified by identifier is associated with the group entity. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupUserCheckEntityExistsViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/groups/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var groupId = _match.Groups["groupId"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/groups/" + + groupId + + "/users/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupUserCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupUserCheckEntityExists_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + case global::System.Net.HttpStatusCode.NotFound: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNotFound(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupUserCheckEntityExists_Validate(string resourceGroupName, string serviceName, string groupId, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Add existing user to existing group + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupUserCreate(string resourceGroupName, string serviceName, string groupId, string userId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupUserCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Add existing user to existing group + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupUserCreateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/groups/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var groupId = _match.Groups["groupId"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/groups/" + + groupId + + "/users/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupUserCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupUserCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupUserCreate_Validate(string resourceGroupName, string serviceName, string groupId, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Remove existing user from existing group. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupUserDelete(string resourceGroupName, string serviceName, string groupId, string userId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupUserDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Remove existing user from existing group. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupUserDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/groups/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var groupId = _match.Groups["groupId"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/groups/" + + groupId + + "/users/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupUserDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupUserDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupUserDelete_Validate(string resourceGroupName, string serviceName, string groupId, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of user entities associated with the group. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupUserList(string resourceGroupName, string serviceName, string groupId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/users" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupUserList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of user entities associated with the group. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupUserListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/groups/(?[^/]+)/users$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/groups/" + + groupId + + "/users" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupUserList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupUserList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Group identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupUserList_Validate(string resourceGroupName, string serviceName, string groupId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or Updates the IdentityProvider configuration. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderCreateOrUpdate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/identityProviders/" + + global::System.Uri.EscapeDataString(identityProviderName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or Updates the IdentityProvider configuration. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/identityProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var identityProviderName = _match.Groups["identityProviderName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/identityProviders/" + + identityProviderName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderCreateOrUpdate_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(identityProviderName),identityProviderName); + await eventListener.AssertEnum(nameof(identityProviderName),identityProviderName,@"facebook", @"google", @"microsoft", @"twitter", @"aad", @"aadB2C"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified identity provider configuration. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderDelete(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/identityProviders/" + + global::System.Uri.EscapeDataString(identityProviderName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified identity provider configuration. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/identityProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var identityProviderName = _match.Groups["identityProviderName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/identityProviders/" + + identityProviderName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderDelete_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(identityProviderName),identityProviderName); + await eventListener.AssertEnum(nameof(identityProviderName),identityProviderName,@"facebook", @"google", @"microsoft", @"twitter", @"aad", @"aadB2C"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the configuration details of the identity Provider configured in specified service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderGet(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/identityProviders/" + + global::System.Uri.EscapeDataString(identityProviderName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the identityProvider specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderGetEntityTag(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/identityProviders/" + + global::System.Uri.EscapeDataString(identityProviderName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the identityProvider specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/identityProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var identityProviderName = _match.Groups["identityProviderName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/identityProviders/" + + identityProviderName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderGetEntityTag_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(identityProviderName),identityProviderName); + await eventListener.AssertEnum(nameof(identityProviderName),identityProviderName,@"facebook", @"google", @"microsoft", @"twitter", @"aad", @"aadB2C"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the configuration details of the identity Provider configured in specified service instance. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/identityProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var identityProviderName = _match.Groups["identityProviderName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/identityProviders/" + + identityProviderName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderGet_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(identityProviderName),identityProviderName); + await eventListener.AssertEnum(nameof(identityProviderName),identityProviderName,@"facebook", @"google", @"microsoft", @"twitter", @"aad", @"aadB2C"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists a collection of Identity Provider configured in the specified service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderListByService(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/identityProviders" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists a collection of Identity Provider configured in the specified service instance. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/identityProviders$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/identityProviders" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderListByService_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the client secret details of the Identity Provider. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderListSecrets(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/identityProviders/" + + global::System.Uri.EscapeDataString(identityProviderName) + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the client secret details of the Identity Provider. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderListSecretsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/identityProviders/(?[^/]+)/listSecrets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var identityProviderName = _match.Groups["identityProviderName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/identityProviders/" + + identityProviderName + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderListSecrets_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ClientSecretContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderListSecrets_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(identityProviderName),identityProviderName); + await eventListener.AssertEnum(nameof(identityProviderName),identityProviderName,@"facebook", @"google", @"microsoft", @"twitter", @"aad", @"aadB2C"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates an existing IdentityProvider configuration. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderUpdate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/identityProviders/" + + global::System.Uri.EscapeDataString(identityProviderName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates an existing IdentityProvider configuration. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IdentityProviderUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/identityProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var identityProviderName = _match.Groups["identityProviderName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/identityProviders/" + + identityProviderName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IdentityProviderUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identity Provider Type identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IdentityProviderUpdate_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType identityProviderName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(identityProviderName),identityProviderName); + await eventListener.AssertEnum(nameof(identityProviderName),identityProviderName,@"facebook", @"google", @"microsoft", @"twitter", @"aad", @"aadB2C"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets API Management issue details + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Issue identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IssueGet(string resourceGroupName, string serviceName, string issueId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/issues/" + + global::System.Uri.EscapeDataString(issueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IssueGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets API Management issue details + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IssueGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/issues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues/{issueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var issueId = _match.Groups["issueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/issues/" + + issueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IssueGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IssueGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Issue identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IssueGet_Validate(string resourceGroupName, string serviceName, string issueId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(issueId),issueId); + await eventListener.AssertMinimumLength(nameof(issueId),issueId,1); + await eventListener.AssertMaximumLength(nameof(issueId),issueId,256); + await eventListener.AssertRegEx(nameof(issueId),issueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of issues in the specified service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| authorName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state + /// | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IssueListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/issues" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IssueListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of issues in the specified service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| authorName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state + /// | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IssueListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/issues$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/issues" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IssueListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IssueListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiId | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| authorName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state + /// | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IssueListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or Updates a logger. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Logger identifier. Must be unique in the API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerCreateOrUpdate(string resourceGroupName, string serviceName, string loggerId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/loggers/" + + global::System.Uri.EscapeDataString(loggerId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or Updates a logger. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/loggers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var loggerId = _match.Groups["loggerId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/loggers/" + + loggerId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Logger identifier. Must be unique in the API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string loggerId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(loggerId),loggerId); + await eventListener.AssertMaximumLength(nameof(loggerId),loggerId,256); + await eventListener.AssertRegEx(nameof(loggerId),loggerId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified logger. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Logger identifier. Must be unique in the API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerDelete(string resourceGroupName, string serviceName, string loggerId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/loggers/" + + global::System.Uri.EscapeDataString(loggerId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified logger. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/loggers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var loggerId = _match.Groups["loggerId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/loggers/" + + loggerId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Logger identifier. Must be unique in the API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerDelete_Validate(string resourceGroupName, string serviceName, string loggerId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(loggerId),loggerId); + await eventListener.AssertMaximumLength(nameof(loggerId),loggerId,256); + await eventListener.AssertRegEx(nameof(loggerId),loggerId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the logger specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Logger identifier. Must be unique in the API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerGet(string resourceGroupName, string serviceName, string loggerId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/loggers/" + + global::System.Uri.EscapeDataString(loggerId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the logger specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Logger identifier. Must be unique in the API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerGetEntityTag(string resourceGroupName, string serviceName, string loggerId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/loggers/" + + global::System.Uri.EscapeDataString(loggerId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the logger specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/loggers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var loggerId = _match.Groups["loggerId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/loggers/" + + loggerId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Logger identifier. Must be unique in the API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerGetEntityTag_Validate(string resourceGroupName, string serviceName, string loggerId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(loggerId),loggerId); + await eventListener.AssertMaximumLength(nameof(loggerId),loggerId,256); + await eventListener.AssertRegEx(nameof(loggerId),loggerId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the logger specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/loggers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var loggerId = _match.Groups["loggerId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/loggers/" + + loggerId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Logger identifier. Must be unique in the API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerGet_Validate(string resourceGroupName, string serviceName, string loggerId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(loggerId),loggerId); + await eventListener.AssertMaximumLength(nameof(loggerId),loggerId,256); + await eventListener.AssertRegEx(nameof(loggerId),loggerId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of loggers in the specified service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| loggerType | filter | eq | |
| resourceId + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/loggers" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of loggers in the specified service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| loggerType | filter | eq | |
| resourceId + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/loggers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/loggers" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| loggerType | filter | eq | |
| resourceId + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates an existing logger. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Logger identifier. Must be unique in the API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerUpdate(string resourceGroupName, string serviceName, string loggerId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/loggers/" + + global::System.Uri.EscapeDataString(loggerId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates an existing logger. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoggerUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/loggers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var loggerId = _match.Groups["loggerId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/loggers/" + + loggerId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoggerUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Logger identifier. Must be unique in the API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoggerUpdate_Validate(string resourceGroupName, string serviceName, string loggerId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(loggerId),loggerId); + await eventListener.AssertMaximumLength(nameof(loggerId),loggerId,256); + await eventListener.AssertRegEx(nameof(loggerId),loggerId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates named value. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueCreateOrUpdate(string resourceGroupName, string serviceName, string namedValueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates named value. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/namedValues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/namedValues/" + + namedValueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string namedValueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific named value from the API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueDelete(string resourceGroupName, string serviceName, string namedValueId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific named value from the API Management service instance. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/namedValues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/namedValues/" + + namedValueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueDelete_Validate(string resourceGroupName, string serviceName, string namedValueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the named value specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueGet(string resourceGroupName, string serviceName, string namedValueId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the named value specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueGetEntityTag(string resourceGroupName, string serviceName, string namedValueId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the named value specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/namedValues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/namedValues/" + + namedValueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueGetEntityTag_Validate(string resourceGroupName, string serviceName, string namedValueId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the named value specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/namedValues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/namedValues/" + + namedValueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueGet_Validate(string resourceGroupName, string serviceName, string namedValueId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of named values defined within a service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all |
| displayName | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains only named value entities which failed refresh. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? isKeyVaultRefreshFailed, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/namedValues" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == isKeyVaultRefreshFailed ? global::System.String.Empty : "isKeyVaultRefreshFailed=" + global::System.Uri.EscapeDataString(isKeyVaultRefreshFailed.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of named values defined within a service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all |
| displayName | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains only named value entities which failed refresh. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, bool? isKeyVaultRefreshFailed, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/namedValues$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/namedValues" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == isKeyVaultRefreshFailed ? global::System.String.Empty : "isKeyVaultRefreshFailed=" + global::System.Uri.EscapeDataString(isKeyVaultRefreshFailed.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all |
| displayName | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains only named value entities which failed refresh. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? isKeyVaultRefreshFailed, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the secret of the named value specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueListValue(string resourceGroupName, string serviceName, string namedValueId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "/listValue" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueListValue_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the secret of the named value specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueListValueViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/namedValues/(?[^/]+)/listValue$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/namedValues/" + + namedValueId + + "/listValue" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueListValue_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueListValue_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueSecretContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueListValue_Validate(string resourceGroupName, string serviceName, string namedValueId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Refresh the secret of the named value specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueRefreshSecret(string resourceGroupName, string serviceName, string namedValueId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "/refreshSecret" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueRefreshSecret_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Refresh the secret of the named value specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueRefreshSecretViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/namedValues/(?[^/]+)/refreshSecret$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/namedValues/" + + namedValueId + + "/refreshSecret" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueRefreshSecret_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueRefreshSecret_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueRefreshSecret_Validate(string resourceGroupName, string serviceName, string namedValueId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the specific named value. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueUpdate(string resourceGroupName, string serviceName, string namedValueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the specific named value. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NamedValueUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/namedValues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/namedValues/" + + namedValueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NamedValueUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the NamedValue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NamedValueUpdate_Validate(string resourceGroupName, string serviceName, string namedValueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Gets the Connectivity Status to the external resources on which the Api Management service depends from inside the Cloud + /// Service. This also returns the DNS Servers as visible to the CloudService. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Location in which the API Management service is deployed. This is one of the Azure Regions + /// like West US, East US, South Central US. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NetworkStatusListByLocation(string subscriptionId, string resourceGroupName, string serviceName, string locationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/locations/" + + global::System.Uri.EscapeDataString(locationName) + + "/networkstatus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NetworkStatusListByLocation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the Connectivity Status to the external resources on which the Api Management service depends from inside the Cloud + /// Service. This also returns the DNS Servers as visible to the CloudService. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NetworkStatusListByLocationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/locations/(?[^/]+)/networkstatus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/locations/{locationName}/networkstatus'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var locationName = _match.Groups["locationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/locations/" + + locationName + + "/networkstatus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NetworkStatusListByLocation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NetworkStatusListByLocation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NetworkStatusContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Location in which the API Management service is deployed. This is one of the Azure Regions + /// like West US, East US, South Central US. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NetworkStatusListByLocation_Validate(string subscriptionId, string resourceGroupName, string serviceName, string locationName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(locationName),locationName); + await eventListener.AssertMinimumLength(nameof(locationName),locationName,1); + } + } + + /// + /// Gets the Connectivity Status to the external resources on which the Api Management service depends from inside the Cloud + /// Service. This also returns the DNS Servers as visible to the CloudService. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NetworkStatusListByService(string subscriptionId, string resourceGroupName, string serviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/networkstatus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NetworkStatusListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the Connectivity Status to the external resources on which the Api Management service depends from inside the Cloud + /// Service. This also returns the DNS Servers as visible to the CloudService. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NetworkStatusListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/networkstatus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/networkstatus'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/networkstatus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NetworkStatusListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NetworkStatusListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __y) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractByLocation) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NetworkStatusContractByLocation.FromJson(__x) )) ))() : null)); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NetworkStatusListByService_Validate(string subscriptionId, string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + + /// Create or Update API Management publisher notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationCreateOrUpdate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string ifMatch, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or Update API Management publisher notification. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications/" + + notificationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NotificationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationCreateOrUpdate_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Notification specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationGet(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the details of the Notification specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications/" + + notificationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NotificationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationGet_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of properties defined within a service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationListByService(string resourceGroupName, string serviceName, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications" + + "?" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of properties defined within a service instance. + /// + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationListByServiceViaIdentity(global::System.String viaIdentity, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications" + + "?" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NotificationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationListByService_Validate(string resourceGroupName, string serviceName, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Determine if Notification Recipient Email subscribed to the notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientEmailCheckEntityExists(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientEmails/" + + global::System.Uri.EscapeDataString(email) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientEmailCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// Determine if Notification Recipient Email subscribed to the notification. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientEmailCheckEntityExistsViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications/(?[^/]+)/recipientEmails/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var email = _match.Groups["email"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications/" + + notificationName + + "/recipientEmails/" + + email + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientEmailCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientEmailCheckEntityExists_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + case global::System.Net.HttpStatusCode.NotFound: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNotFound(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientEmailCheckEntityExists_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(email),email); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds the Email address to the list of Recipients for the Notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientEmailCreateOrUpdate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientEmails/" + + global::System.Uri.EscapeDataString(email) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientEmailCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds the Email address to the list of Recipients for the Notification. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientEmailCreateOrUpdateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications/(?[^/]+)/recipientEmails/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var email = _match.Groups["email"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications/" + + notificationName + + "/recipientEmails/" + + email + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientEmailCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientEmailCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientEmailContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientEmailContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientEmailCreateOrUpdate_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(email),email); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Removes the email from the list of Notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientEmailDelete(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientEmails/" + + global::System.Uri.EscapeDataString(email) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientEmailDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Removes the email from the list of Notification. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientEmailDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications/(?[^/]+)/recipientEmails/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var email = _match.Groups["email"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications/" + + notificationName + + "/recipientEmails/" + + email + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientEmailDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientEmailDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientEmailDelete_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(email),email); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the list of the Notification Recipient Emails subscribed to a notification. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientEmailListByNotification(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientEmails" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientEmailListByNotification_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the list of the Notification Recipient Emails subscribed to a notification. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientEmailListByNotificationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications/(?[^/]+)/recipientEmails$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications/" + + notificationName + + "/recipientEmails" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientEmailListByNotification_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientEmailListByNotification_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientEmailCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientEmailListByNotification_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Determine if the Notification Recipient User is subscribed to the notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientUserCheckEntityExists(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientUsers/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientUserCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// Determine if the Notification Recipient User is subscribed to the notification. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientUserCheckEntityExistsViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications/(?[^/]+)/recipientUsers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications/" + + notificationName + + "/recipientUsers/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientUserCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientUserCheckEntityExists_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + case global::System.Net.HttpStatusCode.NotFound: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNotFound(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientUserCheckEntityExists_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds the API Management User to the list of Recipients for the Notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientUserCreateOrUpdate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientUsers/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientUserCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds the API Management User to the list of Recipients for the Notification. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientUserCreateOrUpdateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications/(?[^/]+)/recipientUsers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications/" + + notificationName + + "/recipientUsers/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientUserCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientUserCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientUserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientUserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientUserCreateOrUpdate_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Removes the API Management user from the list of Notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientUserDelete(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientUsers/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientUserDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Removes the API Management user from the list of Notification. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientUserDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications/(?[^/]+)/recipientUsers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications/" + + notificationName + + "/recipientUsers/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientUserDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientUserDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientUserDelete_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the list of the Notification Recipient User subscribed to the notification. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientUserListByNotification(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientUsers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientUserListByNotification_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the list of the Notification Recipient User subscribed to the notification. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NotificationRecipientUserListByNotificationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/notifications/(?[^/]+)/recipientUsers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/notifications/" + + notificationName + + "/recipientUsers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NotificationRecipientUserListByNotification_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientUserListByNotification_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientUserCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task NotificationRecipientUserListByNotification_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates the OpenID Connect Provider. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderCreateOrUpdate(string resourceGroupName, string serviceName, string opid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/openidConnectProviders/" + + global::System.Uri.EscapeDataString(opid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates the OpenID Connect Provider. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/openidConnectProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var opid = _match.Groups["opid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/openidConnectProviders/" + + opid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string opid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(opid),opid); + await eventListener.AssertMaximumLength(nameof(opid),opid,256); + await eventListener.AssertRegEx(nameof(opid),opid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Deletes specific OpenID Connect Provider of the API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderDelete(string resourceGroupName, string serviceName, string opid, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/openidConnectProviders/" + + global::System.Uri.EscapeDataString(opid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Deletes specific OpenID Connect Provider of the API Management service instance. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/openidConnectProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var opid = _match.Groups["opid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/openidConnectProviders/" + + opid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderDelete_Validate(string resourceGroupName, string serviceName, string opid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(opid),opid); + await eventListener.AssertMaximumLength(nameof(opid),opid,256); + await eventListener.AssertRegEx(nameof(opid),opid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets specific OpenID Connect Provider without secrets. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderGet(string resourceGroupName, string serviceName, string opid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/openidConnectProviders/" + + global::System.Uri.EscapeDataString(opid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderGetEntityTag(string resourceGroupName, string serviceName, string opid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/openidConnectProviders/" + + global::System.Uri.EscapeDataString(opid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/openidConnectProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var opid = _match.Groups["opid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/openidConnectProviders/" + + opid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderGetEntityTag_Validate(string resourceGroupName, string serviceName, string opid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(opid),opid); + await eventListener.AssertMaximumLength(nameof(opid),opid,256); + await eventListener.AssertRegEx(nameof(opid),opid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets specific OpenID Connect Provider without secrets. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/openidConnectProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var opid = _match.Groups["opid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/openidConnectProviders/" + + opid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderGet_Validate(string resourceGroupName, string serviceName, string opid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(opid),opid); + await eventListener.AssertMaximumLength(nameof(opid),opid,256); + await eventListener.AssertRegEx(nameof(opid),opid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists of all the OpenId Connect Providers. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/openidConnectProviders" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists of all the OpenId Connect Providers. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/openidConnectProviders$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/openidConnectProviders" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenIdConnectProviderCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the client secret details of the OpenID Connect Provider. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderListSecrets(string resourceGroupName, string serviceName, string opid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/openidConnectProviders/" + + global::System.Uri.EscapeDataString(opid) + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the client secret details of the OpenID Connect Provider. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderListSecretsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/openidConnectProviders/(?[^/]+)/listSecrets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var opid = _match.Groups["opid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/openidConnectProviders/" + + opid + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderListSecrets_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ClientSecretContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderListSecrets_Validate(string resourceGroupName, string serviceName, string opid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(opid),opid); + await eventListener.AssertMaximumLength(nameof(opid),opid,256); + await eventListener.AssertRegEx(nameof(opid),opid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the specific OpenID Connect Provider. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderUpdate(string resourceGroupName, string serviceName, string opid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/openidConnectProviders/" + + global::System.Uri.EscapeDataString(opid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the specific OpenID Connect Provider. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OpenIdConnectProviderUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/openidConnectProviders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var opid = _match.Groups["opid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/openidConnectProviders/" + + opid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OpenIdConnectProviderUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Identifier of the OpenID Connect Provider. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OpenIdConnectProviderUpdate_Validate(string resourceGroupName, string serviceName, string opid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(opid),opid); + await eventListener.AssertMaximumLength(nameof(opid),opid,256); + await eventListener.AssertRegEx(nameof(opid),opid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Lists a collection of operations associated with tags. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| urlTemplate + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include not tagged Operations. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationListByTags(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, bool? includeNotTaggedOperations, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operationsByTags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == includeNotTaggedOperations ? global::System.String.Empty : "includeNotTaggedOperations=" + global::System.Uri.EscapeDataString(includeNotTaggedOperations.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationListByTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of operations associated with tags. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| urlTemplate + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include not tagged Operations. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationListByTagsViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, bool? includeNotTaggedOperations, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operationsByTags$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operationsByTags'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operationsByTags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == includeNotTaggedOperations ? global::System.String.Empty : "includeNotTaggedOperations=" + global::System.Uri.EscapeDataString(includeNotTaggedOperations.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationListByTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationListByTags_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| urlTemplate + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include not tagged Operations. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationListByTags_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, bool? includeNotTaggedOperations, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the network endpoints of all outbound dependencies of a ApiManagement service. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OutboundNetworkDependenciesEndpointsListByService(string subscriptionId, string resourceGroupName, string serviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/outboundNetworkDependenciesEndpoints" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OutboundNetworkDependenciesEndpointsListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the network endpoints of all outbound dependencies of a ApiManagement service. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OutboundNetworkDependenciesEndpointsListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/outboundNetworkDependenciesEndpoints$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/outboundNetworkDependenciesEndpoints'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/outboundNetworkDependenciesEndpoints" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OutboundNetworkDependenciesEndpointsListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OutboundNetworkDependenciesEndpointsListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OutboundEnvironmentEndpointList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OutboundNetworkDependenciesEndpointsListByService_Validate(string subscriptionId, string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + + /// + /// Performs a connectivity check between the API Management service and a given destination, and returns metrics for the + /// connection, as well as errors encountered while trying to establish it. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Connectivity Check request parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PerformConnectivityCheckAsync(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/connectivityCheck" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PerformConnectivityCheckAsync_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Performs a connectivity check between the API Management service and a given destination, and returns metrics for the + /// connection, as well as errors encountered while trying to establish it. + /// + /// + /// Connectivity Check request parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PerformConnectivityCheckAsyncViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/connectivityCheck$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/connectivityCheck" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PerformConnectivityCheckAsync_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PerformConnectivityCheckAsync_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Connectivity Check request parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PerformConnectivityCheckAsync_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequest body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Creates or updates the global policy configuration of the Api Management service. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyCreateOrUpdate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Creates or updates the global policy configuration of the Api Management service. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the global policy configuration of the Api Management Service. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyDelete(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the global policy configuration of the Api Management Service. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyDelete_Validate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all policy descriptions. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy scope. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyDescriptionListByService(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract? scope, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyDescriptions" + + "?" + + (string.IsNullOrEmpty(scope) ? global::System.String.Empty : "scope=" + global::System.Uri.EscapeDataString(scope)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyDescriptionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all policy descriptions. + /// + /// Policy scope. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyDescriptionListByServiceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract? scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyDescriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyDescriptions'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyDescriptions" + + "?" + + (string.IsNullOrEmpty(scope) ? global::System.String.Empty : "scope=" + global::System.Uri.EscapeDataString(scope)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyDescriptionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyDescriptionListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyDescriptionCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy scope. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyDescriptionListByService_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract? scope, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertEnum(nameof(scope),scope,@"Tenant", @"Product", @"Api", @"Operation", @"All"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates a policy fragment. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// A resource identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy fragment contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentCreateOrUpdate(string resourceGroupName, string serviceName, string id, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyFragments/" + + global::System.Uri.EscapeDataString(id) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates a policy fragment. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy fragment contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyFragments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var id = _match.Groups["id"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyFragments/" + + id + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyFragmentContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// A resource identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy fragment contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string id, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(id),id); + await eventListener.AssertMinimumLength(nameof(id),id,1); + await eventListener.AssertMaximumLength(nameof(id),id,80); + await eventListener.AssertRegEx(nameof(id),id,@"(^[\w]+$)|(^[\w][\w\-]+[\w]$)"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a policy fragment. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// A resource identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentDelete(string resourceGroupName, string serviceName, string id, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyFragments/" + + global::System.Uri.EscapeDataString(id) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a policy fragment. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyFragments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var id = _match.Groups["id"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyFragments/" + + id + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// A resource identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentDelete_Validate(string resourceGroupName, string serviceName, string id, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(id),id); + await eventListener.AssertMinimumLength(nameof(id),id,1); + await eventListener.AssertMaximumLength(nameof(id),id,80); + await eventListener.AssertRegEx(nameof(id),id,@"(^[\w]+$)|(^[\w][\w\-]+[\w]$)"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets a policy fragment. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// Policy fragment content format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentGet(string resourceGroupName, string serviceName, string id, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyFragments/" + + global::System.Uri.EscapeDataString(id) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of a policy fragment. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentGetEntityTag(string resourceGroupName, string serviceName, string id, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyFragments/" + + global::System.Uri.EscapeDataString(id) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of a policy fragment. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyFragments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var id = _match.Groups["id"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyFragments/" + + id + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentGetEntityTag_Validate(string resourceGroupName, string serviceName, string id, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(id),id); + await eventListener.AssertMinimumLength(nameof(id),id,1); + await eventListener.AssertMaximumLength(nameof(id),id,80); + await eventListener.AssertRegEx(nameof(id),id,@"(^[\w]+$)|(^[\w][\w\-]+[\w]$)"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets a policy fragment. + /// + /// Policy fragment content format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyFragments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var id = _match.Groups["id"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyFragments/" + + id + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyFragmentContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// Policy fragment content format. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentGet_Validate(string resourceGroupName, string serviceName, string id, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? format, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(id),id); + await eventListener.AssertMinimumLength(nameof(id),id,1); + await eventListener.AssertMaximumLength(nameof(id),id,80); + await eventListener.AssertRegEx(nameof(id),id,@"(^[\w]+$)|(^[\w][\w\-]+[\w]$)"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + } + } + + /// Gets all policy fragments. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| value | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// OData order by query option. + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentListByService(string resourceGroupName, string serviceName, string subscriptionId, string Filter, string Orderby, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyFragments" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all policy fragments. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| value | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// OData order by query option. + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentListByServiceViaIdentity(global::System.String viaIdentity, string Filter, string Orderby, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyFragments$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyFragments" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyFragmentCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| value | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// OData order by query option. + /// Number of records to return. + /// Number of records to skip. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentListByService_Validate(string resourceGroupName, string serviceName, string subscriptionId, string Filter, string Orderby, int? Top, int? Skip, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(Orderby),Orderby); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + } + } + + /// Lists policy resources that reference the policy fragment. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentListReferences(string resourceGroupName, string serviceName, string id, string subscriptionId, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyFragments/" + + global::System.Uri.EscapeDataString(id) + + "/listReferences" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentListReferences_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists policy resources that reference the policy fragment. + /// + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyFragmentListReferencesViaIdentity(global::System.String viaIdentity, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyFragments/(?[^/]+)/listReferences$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}/listReferences'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var id = _match.Groups["id"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyFragments/" + + id + + "/listReferences" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyFragmentListReferences_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentListReferences_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// Number of records to return. + /// Number of records to skip. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyFragmentListReferences_Validate(string resourceGroupName, string serviceName, string id, string subscriptionId, int? Top, int? Skip, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(id),id); + await eventListener.AssertMinimumLength(nameof(id),id,1); + await eventListener.AssertMaximumLength(nameof(id),id,80); + await eventListener.AssertRegEx(nameof(id),id,@"(^[\w]+$)|(^[\w][\w\-]+[\w]$)"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + } + } + + /// Get the Global policy definition of the Api Management service. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyGet(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyGetEntityTag(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyGetEntityTag_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the Global policy definition of the Api Management service. + /// + /// Policy Export Format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policies/" + + policyId + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyGet_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all the Global Policy definitions of the Api Management service. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyListByService(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all the Global Policy definitions of the Api Management service. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyListByService_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Creates or updates the policy restriction configuration of the Api Management service. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy restrictions after an entity level + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy restriction to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionCreateOrUpdate(string subscriptionId, string resourceGroupName, string serviceName, string policyRestrictionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyRestrictions/" + + global::System.Uri.EscapeDataString(policyRestrictionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Creates or updates the policy restriction configuration of the Api Management service. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy restriction to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyRestrictions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyRestrictions/{policyRestrictionId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var policyRestrictionId = _match.Groups["policyRestrictionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyRestrictions/" + + policyRestrictionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy restrictions after an entity level + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy restriction to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string serviceName, string policyRestrictionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(policyRestrictionId),policyRestrictionId); + await eventListener.AssertMinimumLength(nameof(policyRestrictionId),policyRestrictionId,1); + await eventListener.AssertMaximumLength(nameof(policyRestrictionId),policyRestrictionId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the policy restriction configuration of the Api Management Service. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy restrictions after an entity level + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionDelete(string subscriptionId, string resourceGroupName, string serviceName, string policyRestrictionId, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyRestrictions/" + + global::System.Uri.EscapeDataString(policyRestrictionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the policy restriction configuration of the Api Management Service. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyRestrictions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyRestrictions/{policyRestrictionId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var policyRestrictionId = _match.Groups["policyRestrictionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyRestrictions/" + + policyRestrictionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy restrictions after an entity level + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionDelete_Validate(string subscriptionId, string resourceGroupName, string serviceName, string policyRestrictionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(policyRestrictionId),policyRestrictionId); + await eventListener.AssertMinimumLength(nameof(policyRestrictionId),policyRestrictionId,1); + await eventListener.AssertMaximumLength(nameof(policyRestrictionId),policyRestrictionId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + } + } + + /// Get the policy restriction of the Api Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy restrictions after an entity level + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionGet(string subscriptionId, string resourceGroupName, string serviceName, string policyRestrictionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyRestrictions/" + + global::System.Uri.EscapeDataString(policyRestrictionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the policy restriction in the Api Management service. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy restrictions after an entity level + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionGetEntityTag(string subscriptionId, string resourceGroupName, string serviceName, string policyRestrictionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyRestrictions/" + + global::System.Uri.EscapeDataString(policyRestrictionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the policy restriction in the Api Management service. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyRestrictions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyRestrictions/{policyRestrictionId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var policyRestrictionId = _match.Groups["policyRestrictionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyRestrictions/" + + policyRestrictionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy restrictions after an entity level + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionGetEntityTag_Validate(string subscriptionId, string resourceGroupName, string serviceName, string policyRestrictionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(policyRestrictionId),policyRestrictionId); + await eventListener.AssertMinimumLength(nameof(policyRestrictionId),policyRestrictionId,1); + await eventListener.AssertMaximumLength(nameof(policyRestrictionId),policyRestrictionId,80); + } + } + + /// Get the policy restriction of the Api Management service. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyRestrictions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyRestrictions/{policyRestrictionId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var policyRestrictionId = _match.Groups["policyRestrictionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyRestrictions/" + + policyRestrictionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy restrictions after an entity level + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionGet_Validate(string subscriptionId, string resourceGroupName, string serviceName, string policyRestrictionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(policyRestrictionId),policyRestrictionId); + await eventListener.AssertMinimumLength(nameof(policyRestrictionId),policyRestrictionId,1); + await eventListener.AssertMaximumLength(nameof(policyRestrictionId),policyRestrictionId,80); + } + } + + /// Gets all policy restrictions of API Management services. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionListByService(string subscriptionId, string resourceGroupName, string serviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyRestrictions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all policy restrictions of API Management services. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyRestrictions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyRestrictions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyRestrictions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionListByService_Validate(string subscriptionId, string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + + /// Updates the policy restriction configuration of the Api Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy restrictions after an entity level + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The policy restriction to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionUpdate(string subscriptionId, string resourceGroupName, string serviceName, string policyRestrictionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/policyRestrictions/" + + global::System.Uri.EscapeDataString(policyRestrictionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the policy restriction configuration of the Api Management service. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The policy restriction to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/policyRestrictions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyRestrictions/{policyRestrictionId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var policyRestrictionId = _match.Groups["policyRestrictionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/policyRestrictions/" + + policyRestrictionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Policy restrictions after an entity level + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The policy restriction to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionUpdate_Validate(string subscriptionId, string resourceGroupName, string serviceName, string policyRestrictionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(policyRestrictionId),policyRestrictionId); + await eventListener.AssertMinimumLength(nameof(policyRestrictionId),policyRestrictionId,1); + await eventListener.AssertMaximumLength(nameof(policyRestrictionId),policyRestrictionId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Validate all policies of API Management services. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionValidationsByService(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/validatePolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionValidationsByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Validate all policies of API Management services. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PolicyRestrictionValidationsByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/validatePolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/validatePolicies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/validatePolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PolicyRestrictionValidationsByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionValidationsByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationResultContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PolicyRestrictionValidationsByService_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Create or update the developer portal configuration. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal configuration identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update the developer portal configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalConfigCreateOrUpdate(string subscriptionId, string resourceGroupName, string serviceName, string portalConfigId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalconfigs/" + + global::System.Uri.EscapeDataString(portalConfigId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalConfigCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or update the developer portal configuration. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update the developer portal configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalConfigCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalconfigs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var portalConfigId = _match.Groups["portalConfigId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalconfigs/" + + portalConfigId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalConfigCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalConfigCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal configuration identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update the developer portal configuration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalConfigCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string serviceName, string portalConfigId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(portalConfigId),portalConfigId); + await eventListener.AssertMinimumLength(nameof(portalConfigId),portalConfigId,1); + await eventListener.AssertMaximumLength(nameof(portalConfigId),portalConfigId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get the developer portal configuration. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal configuration identifier. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalConfigGet(string subscriptionId, string resourceGroupName, string serviceName, string portalConfigId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalconfigs/" + + global::System.Uri.EscapeDataString(portalConfigId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalConfigGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the developer portal configuration. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal configuration identifier. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalConfigGetEntityTag(string subscriptionId, string resourceGroupName, string serviceName, string portalConfigId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalconfigs/" + + global::System.Uri.EscapeDataString(portalConfigId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalConfigGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the developer portal configuration. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalConfigGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalconfigs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var portalConfigId = _match.Groups["portalConfigId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalconfigs/" + + portalConfigId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalConfigGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalConfigGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal configuration identifier. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalConfigGetEntityTag_Validate(string subscriptionId, string resourceGroupName, string serviceName, string portalConfigId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(portalConfigId),portalConfigId); + await eventListener.AssertMinimumLength(nameof(portalConfigId),portalConfigId,1); + await eventListener.AssertMaximumLength(nameof(portalConfigId),portalConfigId,80); + } + } + + /// Get the developer portal configuration. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalConfigGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalconfigs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var portalConfigId = _match.Groups["portalConfigId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalconfigs/" + + portalConfigId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalConfigGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalConfigGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal configuration identifier. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalConfigGet_Validate(string subscriptionId, string resourceGroupName, string serviceName, string portalConfigId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(portalConfigId),portalConfigId); + await eventListener.AssertMinimumLength(nameof(portalConfigId),portalConfigId,1); + await eventListener.AssertMaximumLength(nameof(portalConfigId),portalConfigId,80); + } + } + + /// Lists the developer portal configurations. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalConfigListByService(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalconfigs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalConfigListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the developer portal configurations. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalConfigListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalconfigs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalconfigs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalConfigListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalConfigListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalConfigListByService_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Update the developer portal configuration. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal configuration identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update the developer portal configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalConfigUpdate(string subscriptionId, string resourceGroupName, string serviceName, string portalConfigId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalconfigs/" + + global::System.Uri.EscapeDataString(portalConfigId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalConfigUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Update the developer portal configuration. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update the developer portal configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalConfigUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalconfigs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var portalConfigId = _match.Groups["portalConfigId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalconfigs/" + + portalConfigId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalConfigUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalConfigUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal configuration identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update the developer portal configuration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalConfigUpdate_Validate(string subscriptionId, string resourceGroupName, string serviceName, string portalConfigId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(portalConfigId),portalConfigId); + await eventListener.AssertMinimumLength(nameof(portalConfigId),portalConfigId,1); + await eventListener.AssertMaximumLength(nameof(portalConfigId),portalConfigId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Creates a new developer portal's revision by running the portal's publishing. The `isCurrent` property indicates if the + /// revision is publicly accessible. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Portal Revision's contract details. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalRevisionCreateOrUpdate(string resourceGroupName, string serviceName, string portalRevisionId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalRevisions/" + + global::System.Uri.EscapeDataString(portalRevisionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalRevisionCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// + /// Creates a new developer portal's revision by running the portal's publishing. The `isCurrent` property indicates if the + /// revision is publicly accessible. + /// + /// + /// Portal Revision's contract details. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalRevisionCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalRevisions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var portalRevisionId = _match.Groups["portalRevisionId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalRevisions/" + + portalRevisionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalRevisionCreateOrUpdate_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalRevisionCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Portal Revision's contract details. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalRevisionCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string portalRevisionId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(portalRevisionId),portalRevisionId); + await eventListener.AssertMinimumLength(nameof(portalRevisionId),portalRevisionId,1); + await eventListener.AssertMaximumLength(nameof(portalRevisionId),portalRevisionId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets the developer portal's revision specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalRevisionGet(string resourceGroupName, string serviceName, string portalRevisionId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalRevisions/" + + global::System.Uri.EscapeDataString(portalRevisionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalRevisionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the developer portal revision specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalRevisionGetEntityTag(string resourceGroupName, string serviceName, string portalRevisionId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalRevisions/" + + global::System.Uri.EscapeDataString(portalRevisionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalRevisionGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the developer portal revision specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalRevisionGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalRevisions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var portalRevisionId = _match.Groups["portalRevisionId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalRevisions/" + + portalRevisionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalRevisionGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalRevisionGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalRevisionGetEntityTag_Validate(string resourceGroupName, string serviceName, string portalRevisionId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(portalRevisionId),portalRevisionId); + await eventListener.AssertMinimumLength(nameof(portalRevisionId),portalRevisionId,1); + await eventListener.AssertMaximumLength(nameof(portalRevisionId),portalRevisionId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the developer portal's revision specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalRevisionGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalRevisions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var portalRevisionId = _match.Groups["portalRevisionId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalRevisions/" + + portalRevisionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalRevisionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalRevisionGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalRevisionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalRevisionGet_Validate(string resourceGroupName, string serviceName, string portalRevisionId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(portalRevisionId),portalRevisionId); + await eventListener.AssertMinimumLength(nameof(portalRevisionId),portalRevisionId,1); + await eventListener.AssertMaximumLength(nameof(portalRevisionId),portalRevisionId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists developer portal's revisions. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Supported operators | Supported functions | + /// |-------------|------------------------|-----------------------------------| + /// + /// |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| + /// |description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| + /// |isCurrent | eq, ne | | + /// + /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalRevisionListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalRevisions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalRevisionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists developer portal's revisions. + /// + /// | Field | Supported operators | Supported functions | + /// |-------------|------------------------|-----------------------------------| + /// + /// |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| + /// |description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| + /// |isCurrent | eq, ne | | + /// + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalRevisionListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalRevisions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalRevisions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalRevisionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalRevisionListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalRevisionCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Supported operators | Supported functions | + /// |-------------|------------------------|-----------------------------------| + /// + /// |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| + /// |description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| + /// |isCurrent | eq, ne | | + /// + /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalRevisionListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the description of specified portal revision or makes it current. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Portal Revision's contract details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalRevisionUpdate(string resourceGroupName, string serviceName, string portalRevisionId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalRevisions/" + + global::System.Uri.EscapeDataString(portalRevisionId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalRevisionUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the description of specified portal revision or makes it current. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Portal Revision's contract details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalRevisionUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalRevisions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var portalRevisionId = _match.Groups["portalRevisionId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalRevisions/" + + portalRevisionId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalRevisionUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalRevisionUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalRevisionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Portal Revision's contract details. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalRevisionUpdate_Validate(string resourceGroupName, string serviceName, string portalRevisionId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(portalRevisionId),portalRevisionId); + await eventListener.AssertMinimumLength(nameof(portalRevisionId),portalRevisionId,1); + await eventListener.AssertMaximumLength(nameof(portalRevisionId),portalRevisionId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Lists a collection of portalsettings defined within a service instance.. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalSettingsListByService(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalSettingsListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of portalsettings defined within a service instance.. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PortalSettingsListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PortalSettingsListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalSettingsListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSettingsCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PortalSettingsListByService_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a new Private Endpoint Connection or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Name of the private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// A request to approve or reject a private endpoint connection + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionCreateOrUpdate(string resourceGroupName, string serviceName, string privateEndpointConnectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates a new Private Endpoint Connection or updates an existing one. + /// + /// A request to approve or reject a private endpoint connection + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Name of the private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// A request to approve or reject a private endpoint connection + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string privateEndpointConnectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequest body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified Private Endpoint Connection. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Name of the private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionDelete(string resourceGroupName, string serviceName, string privateEndpointConnectionName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified Private Endpoint Connection. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Name of the private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionDelete_Validate(string resourceGroupName, string serviceName, string privateEndpointConnectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the details of the Private Endpoint Connection specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Name of the private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionGetByName(string resourceGroupName, string serviceName, string privateEndpointConnectionName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionGetByName_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the details of the Private Endpoint Connection specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionGetByNameViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionGetByName_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionGetByName_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Name of the private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionGetByName_Validate(string resourceGroupName, string serviceName, string privateEndpointConnectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the private link resources + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the API Management service. + /// Name of the private link resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionGetPrivateLinkResource(string resourceGroupName, string subscriptionId, string serviceName, string privateLinkSubResourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/privateLinkResources/" + + global::System.Uri.EscapeDataString(privateLinkSubResourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionGetPrivateLinkResource_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the private link resources + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionGetPrivateLinkResourceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/privateLinkResources/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources/{privateLinkSubResourceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var privateLinkSubResourceName = _match.Groups["privateLinkSubResourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/privateLinkResources/" + + privateLinkSubResourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionGetPrivateLinkResource_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionGetPrivateLinkResource_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the API Management service. + /// Name of the private link resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionGetPrivateLinkResource_Validate(string resourceGroupName, string subscriptionId, string serviceName, string privateLinkSubResourceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(privateLinkSubResourceName),privateLinkSubResourceName); + } + } + + /// Lists all private endpoint connections of the API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionListByService(string subscriptionId, string resourceGroupName, string serviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all private endpoint connections of the API Management service instance. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/privateEndpointConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionListByService_Validate(string subscriptionId, string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + + /// Gets the private link resources + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the API Management service. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionListPrivateLinkResources(string resourceGroupName, string subscriptionId, string serviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionListPrivateLinkResources_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the private link resources + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionListPrivateLinkResourcesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/privateLinkResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var serviceName = _match.Groups["serviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionListPrivateLinkResources_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionListPrivateLinkResources_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the API Management service. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionListPrivateLinkResources_Validate(string resourceGroupName, string subscriptionId, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + + /// + /// Checks that API entity specified by identifier is associated with the Product entity. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiCheckEntityExists(string resourceGroupName, string serviceName, string productId, string apiId, string subscriptionId, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiCheckEntityExists_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Checks that API entity specified by identifier is associated with the Product entity. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiCheckEntityExistsViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiCheckEntityExists_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiCheckEntityExists_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiCheckEntityExists_Validate(string resourceGroupName, string serviceName, string productId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds an API to the specified product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiCreateOrUpdate(string resourceGroupName, string serviceName, string productId, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds an API to the specified product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiCreateOrUpdateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string productId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Deletes the specified API from the specified product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiDelete(string resourceGroupName, string serviceName, string productId, string apiId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified API from the specified product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiDelete_Validate(string resourceGroupName, string serviceName, string productId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds an API to the specified product via link. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiLinkCreateOrUpdate(string resourceGroupName, string serviceName, string productId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds an API to the specified product via link. + /// + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiLinkCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiLinkCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiLinkCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string productId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified API from the specified product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiLinkDelete(string resourceGroupName, string serviceName, string productId, string apiLinkId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified API from the specified product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiLinkDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiLinkDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiLinkDelete_Validate(string resourceGroupName, string serviceName, string productId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the API link for the product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiLinkGet(string resourceGroupName, string serviceName, string productId, string apiLinkId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the API link for the product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiLinkGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiLinkGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiLinkGet_Validate(string resourceGroupName, string serviceName, string productId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the API links associated with a product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiLinkListByProduct(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apiLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the API links associated with a product. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiLinkListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/apiLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apiLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/apiLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiLinkListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiLinkListByProduct_Validate(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the APIs associated with a product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiListByProduct(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the APIs associated with a product. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductApiListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/apis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/apis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductApiListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductApiListByProduct_Validate(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or Updates a product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductCreateOrUpdate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or Updates a product. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Delete existing subscriptions associated with the product or not. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductDelete(string resourceGroupName, string serviceName, string productId, string ifMatch, bool? deleteSubscriptions, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "?" + + (null == deleteSubscriptions ? global::System.String.Empty : "deleteSubscriptions=" + global::System.Uri.EscapeDataString(deleteSubscriptions.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete product. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Delete existing subscriptions associated with the product or not. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, bool? deleteSubscriptions, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "?" + + (null == deleteSubscriptions ? global::System.String.Empty : "deleteSubscriptions=" + global::System.Uri.EscapeDataString(deleteSubscriptions.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Delete existing subscriptions associated with the product or not. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductDelete_Validate(string resourceGroupName, string serviceName, string productId, string ifMatch, bool? deleteSubscriptions, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the product specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGet(string resourceGroupName, string serviceName, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the product specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGetEntityTag(string resourceGroupName, string serviceName, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the product specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGetEntityTag_Validate(string resourceGroupName, string serviceName, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the product specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGet_Validate(string resourceGroupName, string serviceName, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Checks that Group entity specified by identifier is associated with the Product entity. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupCheckEntityExists(string resourceGroupName, string serviceName, string productId, string groupId, string subscriptionId, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupCheckEntityExists_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Checks that Group entity specified by identifier is associated with the Product entity. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupCheckEntityExistsViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupCheckEntityExists_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupCheckEntityExists_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupCheckEntityExists_Validate(string resourceGroupName, string serviceName, string productId, string groupId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Adds the association between the specified developer group with the specified product. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupCreateOrUpdate(string resourceGroupName, string serviceName, string productId, string groupId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Adds the association between the specified developer group with the specified product. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupCreateOrUpdateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string productId, string groupId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Deletes the association between the specified group and product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupDelete(string resourceGroupName, string serviceName, string productId, string groupId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the association between the specified group and product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupDelete_Validate(string resourceGroupName, string serviceName, string productId, string groupId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds a group to the specified product via link. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupLinkCreateOrUpdate(string resourceGroupName, string serviceName, string productId, string groupLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groupLinks/" + + global::System.Uri.EscapeDataString(groupLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds a group to the specified product via link. + /// + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupLinkCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/groupLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groupLinks/{groupLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var groupLinkId = _match.Groups["groupLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/groupLinks/" + + groupLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupLinkCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupLinkCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string productId, string groupLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(groupLinkId),groupLinkId); + await eventListener.AssertMinimumLength(nameof(groupLinkId),groupLinkId,1); + await eventListener.AssertMaximumLength(nameof(groupLinkId),groupLinkId,80); + await eventListener.AssertRegEx(nameof(groupLinkId),groupLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified group from the specified product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupLinkDelete(string resourceGroupName, string serviceName, string productId, string groupLinkId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groupLinks/" + + global::System.Uri.EscapeDataString(groupLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified group from the specified product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupLinkDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/groupLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groupLinks/{groupLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var groupLinkId = _match.Groups["groupLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/groupLinks/" + + groupLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupLinkDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupLinkDelete_Validate(string resourceGroupName, string serviceName, string productId, string groupLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(groupLinkId),groupLinkId); + await eventListener.AssertMinimumLength(nameof(groupLinkId),groupLinkId,1); + await eventListener.AssertMaximumLength(nameof(groupLinkId),groupLinkId,80); + await eventListener.AssertRegEx(nameof(groupLinkId),groupLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the group link for the product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupLinkGet(string resourceGroupName, string serviceName, string productId, string groupLinkId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groupLinks/" + + global::System.Uri.EscapeDataString(groupLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the group link for the product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupLinkGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/groupLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groupLinks/{groupLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var groupLinkId = _match.Groups["groupLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/groupLinks/" + + groupLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupLinkGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupLinkGet_Validate(string resourceGroupName, string serviceName, string productId, string groupLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(groupLinkId),groupLinkId); + await eventListener.AssertMinimumLength(nameof(groupLinkId),groupLinkId,1); + await eventListener.AssertMaximumLength(nameof(groupLinkId),groupLinkId,80); + await eventListener.AssertRegEx(nameof(groupLinkId),groupLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the group links associated with a product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// groupId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupLinkListByProduct(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groupLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the group links associated with a product. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// groupId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupLinkListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/groupLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groupLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/groupLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupLinkListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// groupId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupLinkListByProduct_Validate(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists the collection of developer groups associated with the specified product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | |
| displayName | filter | eq, ne | |
| description | filter | eq, ne + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupListByProduct(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groups" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the collection of developer groups associated with the specified product. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | |
| displayName | filter | eq, ne | |
| description | filter | eq, ne + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductGroupListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/groups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/groups" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductGroupListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | |
| displayName | filter | eq, ne | |
| description | filter | eq, ne + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductGroupListByProduct_Validate(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of products in the specified service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| state | filter | eq | |
| groups | expand | | |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains an array of groups that have visibility to the product. + /// The default is false. + /// Products which are part of a specific tag. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? expandGroups, string tags, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == expandGroups ? global::System.String.Empty : "expandGroups=" + global::System.Uri.EscapeDataString(expandGroups.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of products in the specified service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| state | filter | eq | |
| groups | expand | | |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains an array of groups that have visibility to the product. + /// The default is false. + /// Products which are part of a specific tag. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, bool? expandGroups, string tags, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == expandGroups ? global::System.String.Empty : "expandGroups=" + global::System.Uri.EscapeDataString(expandGroups.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| state | filter | eq | |
| groups | expand | | |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains an array of groups that have visibility to the product. + /// The default is false. + /// Products which are part of a specific tag. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? expandGroups, string tags, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(tags),tags); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of products associated with tags. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| state | filter | eq | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include not tagged Products. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductListByTags(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? includeNotTaggedProducts, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/productsByTags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == includeNotTaggedProducts ? global::System.String.Empty : "includeNotTaggedProducts=" + global::System.Uri.EscapeDataString(includeNotTaggedProducts.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductListByTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of products associated with tags. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| state | filter | eq | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include not tagged Products. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductListByTagsViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, bool? includeNotTaggedProducts, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/productsByTags$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/productsByTags'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/productsByTags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == includeNotTaggedProducts ? global::System.String.Empty : "includeNotTaggedProducts=" + global::System.Uri.EscapeDataString(includeNotTaggedProducts.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductListByTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductListByTags_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| state | filter | eq | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include not tagged Products. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductListByTags_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? includeNotTaggedProducts, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates policy configuration for the Product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductPolicyCreateOrUpdate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates policy configuration for the Product. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductPolicyCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductPolicyCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductPolicyCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the policy configuration at the Product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductPolicyDelete(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the policy configuration at the Product. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductPolicyDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductPolicyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductPolicyDelete_Validate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the Product level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductPolicyGet(string resourceGroupName, string serviceName, string productId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the ETag of the policy configuration at the Product level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductPolicyGetEntityTag(string resourceGroupName, string serviceName, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the ETag of the policy configuration at the Product level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductPolicyGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductPolicyGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductPolicyGetEntityTag_Validate(string resourceGroupName, string serviceName, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the Product level. + /// + /// Policy Export Format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductPolicyGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/policies/" + + policyId + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductPolicyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductPolicyGet_Validate(string resourceGroupName, string serviceName, string productId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the Product level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductPolicyListByProduct(string resourceGroupName, string serviceName, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductPolicyListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the policy configuration at the Product level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductPolicyListByProductViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductPolicyListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductPolicyListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductPolicyListByProduct_Validate(string resourceGroupName, string serviceName, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists the collection of subscriptions to the specified product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductSubscriptionsList(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/subscriptions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductSubscriptionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the collection of subscriptions to the specified product. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductSubscriptionsListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/subscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/subscriptions'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/subscriptions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductSubscriptionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductSubscriptionsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductSubscriptionsList_Validate(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Update existing product details. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductUpdate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Update existing product details. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductUpdate_Validate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates a new Wiki for a Product or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikiCreateOrUpdate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikiCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new Wiki for a Product or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikiCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/wikis/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikiCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikiCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikiCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified Wiki from a Product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikiDelete(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikiDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified Wiki from a Product. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikiDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/wikis/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikiDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikiDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikiDelete_Validate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Wiki for a Product specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikiGet(string resourceGroupName, string serviceName, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikiGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Wiki for a Product specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikiGetEntityTag(string resourceGroupName, string serviceName, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikiGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Wiki for a Product specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikiGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/wikis/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikiGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikiGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikiGetEntityTag_Validate(string resourceGroupName, string serviceName, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Wiki for a Product specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikiGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/wikis/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikiGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikiGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikiGet_Validate(string resourceGroupName, string serviceName, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the Wiki for a Product specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Wiki Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikiUpdate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikiUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the Wiki for a Product specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Wiki Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikiUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/wikis/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/wikis/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikiUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikiUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Wiki Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikiUpdate_Validate(string resourceGroupName, string serviceName, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets the details of the Wiki for a Product specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq | contains |
+ /// Number of records to return. + /// Number of records to skip. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikisList(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/wikis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikisList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the details of the Wiki for a Product specified by its identifier. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq | contains |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ProductWikisListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/wikis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/wikis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ProductWikisList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikisList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | eq | contains |
+ /// Number of records to return. + /// Number of records to skip. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ProductWikisList_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists a collection of current quota counter periods associated with the counter-key configured in the policy on the specified + /// service instance. The api does not support paging yet. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute + /// of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" + /// counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QuotaByCounterKeysListByService(string resourceGroupName, string serviceName, string quotaCounterKey, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/quotas/" + + global::System.Uri.EscapeDataString(quotaCounterKey) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QuotaByCounterKeysListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists a collection of current quota counter periods associated with the counter-key configured in the policy on the specified + /// service instance. The api does not support paging yet. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QuotaByCounterKeysListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/quotas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var quotaCounterKey = _match.Groups["quotaCounterKey"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/quotas/" + + quotaCounterKey + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QuotaByCounterKeysListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QuotaByCounterKeysListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute + /// of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" + /// counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QuotaByCounterKeysListByService_Validate(string resourceGroupName, string serviceName, string quotaCounterKey, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(quotaCounterKey),quotaCounterKey); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Updates all the quota counter values specified with the existing quota counter key to a value in the specified service + /// instance. This should be used for reset of the quota counter values. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute + /// of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" + /// counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// The ID of the target subscription. The value must be an UUID. + /// The value of the quota counter to be applied to all quota counter periods. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QuotaByCounterKeysUpdate(string resourceGroupName, string serviceName, string quotaCounterKey, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/quotas/" + + global::System.Uri.EscapeDataString(quotaCounterKey) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QuotaByCounterKeysUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Updates all the quota counter values specified with the existing quota counter key to a value in the specified service + /// instance. This should be used for reset of the quota counter values. + /// + /// + /// The value of the quota counter to be applied to all quota counter periods. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QuotaByCounterKeysUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/quotas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var quotaCounterKey = _match.Groups["quotaCounterKey"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/quotas/" + + quotaCounterKey + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QuotaByCounterKeysUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QuotaByCounterKeysUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute + /// of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" + /// counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// The ID of the target subscription. The value must be an UUID. + /// The value of the quota counter to be applied to all quota counter periods. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QuotaByCounterKeysUpdate_Validate(string resourceGroupName, string serviceName, string quotaCounterKey, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(quotaCounterKey),quotaCounterKey); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Gets the value of the quota counter associated with the counter-key in the policy for the specific period in service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute + /// of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" + /// counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// Quota period key identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QuotaByPeriodKeysGet(string resourceGroupName, string serviceName, string quotaCounterKey, string quotaPeriodKey, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/quotas/" + + global::System.Uri.EscapeDataString(quotaCounterKey) + + "/periods/" + + global::System.Uri.EscapeDataString(quotaPeriodKey) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QuotaByPeriodKeysGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the value of the quota counter associated with the counter-key in the policy for the specific period in service instance. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QuotaByPeriodKeysGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/quotas/(?[^/]+)/periods/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var quotaCounterKey = _match.Groups["quotaCounterKey"].Value; + var quotaPeriodKey = _match.Groups["quotaPeriodKey"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/quotas/" + + quotaCounterKey + + "/periods/" + + quotaPeriodKey + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QuotaByPeriodKeysGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QuotaByPeriodKeysGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute + /// of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" + /// counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// Quota period key identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QuotaByPeriodKeysGet_Validate(string resourceGroupName, string serviceName, string quotaCounterKey, string quotaPeriodKey, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(quotaCounterKey),quotaCounterKey); + await eventListener.AssertNotNull(nameof(quotaPeriodKey),quotaPeriodKey); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates an existing quota counter value in the specified service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute + /// of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" + /// counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// Quota period key identifier. + /// The ID of the target subscription. The value must be an UUID. + /// The value of the Quota counter to be applied on the specified period. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QuotaByPeriodKeysUpdate(string resourceGroupName, string serviceName, string quotaCounterKey, string quotaPeriodKey, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/quotas/" + + global::System.Uri.EscapeDataString(quotaCounterKey) + + "/periods/" + + global::System.Uri.EscapeDataString(quotaPeriodKey) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QuotaByPeriodKeysUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates an existing quota counter value in the specified service instance. + /// + /// The value of the Quota counter to be applied on the specified period. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QuotaByPeriodKeysUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/quotas/(?[^/]+)/periods/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var quotaCounterKey = _match.Groups["quotaCounterKey"].Value; + var quotaPeriodKey = _match.Groups["quotaPeriodKey"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/quotas/" + + quotaCounterKey + + "/periods/" + + quotaPeriodKey + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QuotaByPeriodKeysUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QuotaByPeriodKeysUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute + /// of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" + /// counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// Quota period key identifier. + /// The ID of the target subscription. The value must be an UUID. + /// The value of the Quota counter to be applied on the specified period. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QuotaByPeriodKeysUpdate_Validate(string resourceGroupName, string serviceName, string quotaCounterKey, string quotaPeriodKey, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(quotaCounterKey),quotaCounterKey); + await eventListener.AssertNotNull(nameof(quotaPeriodKey),quotaPeriodKey); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Lists all azure regions in which the service exists. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RegionListByService(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/regions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RegionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all azure regions in which the service exists. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RegionListByServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/regions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/regions'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/regions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RegionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RegionListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RegionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RegionListByService_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists report records by API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The filter to apply on the operation. + /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByApi(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/reports/byApi" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists report records by API. + /// + /// The filter to apply on the operation. + /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByApiViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string Orderby, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/reports/byApi$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byApi'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/reports/byApi" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ReportCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The filter to apply on the operation. + /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByApi_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(Orderby),Orderby); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists report records by geography. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| country | select | | |
| region | select | | |
| zip | select | | |
| + /// apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | |
| subscriptionId | + /// filter | eq | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select | + /// | |
| callCountBlocked | select | | |
| callCountFailed | select | | |
| callCountOther | select | | | + ///
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| + /// apiTimeAvg | select | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select + /// | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByGeo(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/reports/byGeo" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByGeo_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists report records by geography. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| country | select | | |
| region | select | | |
| zip | select | | |
| + /// apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | |
| subscriptionId | + /// filter | eq | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select | + /// | |
| callCountBlocked | select | | |
| callCountFailed | select | | |
| callCountOther | select | | | + ///
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| + /// apiTimeAvg | select | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select + /// | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByGeoViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/reports/byGeo$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byGeo'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/reports/byGeo" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByGeo_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByGeo_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ReportCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| country | select | | |
| region | select | | |
| zip | select | | |
| + /// apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | |
| subscriptionId | + /// filter | eq | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select | + /// | |
| callCountBlocked | select | | |
| callCountFailed | select | | |
| callCountOther | select | | | + ///
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| + /// apiTimeAvg | select | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select + /// | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByGeo_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists report records by API Operations. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId + /// | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq + /// | |
| operationId | select, filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked + /// | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| + /// callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| + /// cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax + /// | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select + /// | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByOperation(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/reports/byOperation" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists report records by API Operations. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId + /// | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq + /// | |
| operationId | select, filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked + /// | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| + /// callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| + /// cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax + /// | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select + /// | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByOperationViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string Orderby, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/reports/byOperation$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byOperation'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/reports/byOperation" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ReportCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId + /// | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq + /// | |
| operationId | select, filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked + /// | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| + /// callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| + /// cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax + /// | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select + /// | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByOperation_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(Orderby),Orderby); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists report records by Product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId + /// | filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | filter | eq | |
| callCountSuccess + /// | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | | + ///
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, + /// orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy + /// | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin + /// | select | | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByProduct(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/reports/byProduct" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists report records by Product. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId + /// | filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | filter | eq | |
| callCountSuccess + /// | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | | + ///
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, + /// orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy + /// | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin + /// | select | | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string Orderby, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/reports/byProduct$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byProduct'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/reports/byProduct" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ReportCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId + /// | filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | filter | eq | |
| callCountSuccess + /// | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | | + ///
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, + /// orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy + /// | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin + /// | select | | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByProduct_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(Orderby),Orderby); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists report records by Request. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| productId | + /// filter | eq | |
| userId | filter | eq | |
| apiRegion | filter | eq | |
| subscriptionId | filter | eq + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByRequest(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/reports/byRequest" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByRequest_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists report records by Request. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| productId | + /// filter | eq | |
| userId | filter | eq | |
| apiRegion | filter | eq | |
| subscriptionId | filter | eq + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByRequestViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/reports/byRequest$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byRequest'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/reports/byRequest" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByRequest_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByRequest_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RequestReportCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| productId | + /// filter | eq | |
| userId | filter | eq | |
| apiRegion | filter | eq | |
| subscriptionId | filter | eq + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByRequest_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists report records by subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId + /// | select, filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | select, filter | eq | |
| + /// callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, + /// orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth + /// | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | + /// select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select + /// | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListBySubscription(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/reports/bySubscription" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists report records by subscription. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId + /// | select, filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | select, filter | eq | |
| + /// callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, + /// orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth + /// | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | + /// select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select + /// | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListBySubscriptionViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string Orderby, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/reports/bySubscription$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/bySubscription'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/reports/bySubscription" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ReportCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId + /// | select, filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | select, filter | eq | |
| + /// callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, + /// orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth + /// | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | + /// select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select + /// | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListBySubscription_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(Orderby),Orderby); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists report records by Time. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter, select | ge, le | |
| interval | select | | |
| apiRegion | filter | eq | |
| userId + /// | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq + /// | |
| operationId | filter | eq | |
| callCountSuccess | select | | |
| callCountBlocked | select | | | + ///
| callCountFailed | select | | |
| callCountOther | select | | |
| bandwidth | select, orderBy | | |
| + /// cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select | | |
| apiTimeMin + /// | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | + /// | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + /// be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a + /// valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByTime(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, global::System.TimeSpan interval, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/reports/byTime" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "interval=" + global::System.Uri.EscapeDataString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)interval)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByTime_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists report records by Time. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter, select | ge, le | |
| interval | select | | |
| apiRegion | filter | eq | |
| userId + /// | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq + /// | |
| operationId | filter | eq | |
| callCountSuccess | select | | |
| callCountBlocked | select | | | + ///
| callCountFailed | select | | |
| callCountOther | select | | |
| bandwidth | select, orderBy | | |
| + /// cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select | | |
| apiTimeMin + /// | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | + /// | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + /// be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a + /// valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByTimeViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string Orderby, global::System.TimeSpan interval, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/reports/byTime$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/reports/byTime" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "interval=" + global::System.Uri.EscapeDataString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)interval)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByTime_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByTime_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ReportCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter, select | ge, le | |
| interval | select | | |
| apiRegion | filter | eq | |
| userId + /// | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq + /// | |
| operationId | filter | eq | |
| callCountSuccess | select | | |
| callCountBlocked | select | | | + ///
| callCountFailed | select | | |
| callCountOther | select | | |
| bandwidth | select, orderBy | | |
| + /// cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select | | |
| apiTimeMin + /// | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | + /// | |
| serviceTimeMax | select | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + /// be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a + /// valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByTime_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, global::System.TimeSpan interval, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(Orderby),Orderby); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists report records by User. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| userId | select, filter | eq | |
| + /// apiRegion | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | + /// filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked + /// | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| + /// callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| + /// cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax + /// | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select + /// | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByUser(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/reports/byUser" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByUser_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists report records by User. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| userId | select, filter | eq | |
| + /// apiRegion | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | + /// filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked + /// | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| + /// callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| + /// cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax + /// | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select + /// | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReportsListByUserViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string Orderby, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/reports/byUser$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byUser'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/reports/byUser" + + "?" + + "$filter=" + global::System.Uri.EscapeDataString(Filter) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReportsListByUser_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByUser_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ReportCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| userId | select, filter | eq | |
| + /// apiRegion | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | + /// filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked + /// | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| + /// callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| + /// cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax + /// | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select + /// | | |
+ /// Number of records to return. + /// Number of records to skip. + /// OData order by query option. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ReportsListByUser_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string Orderby, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(Orderby),Orderby); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Create or Update Sign-In settings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignInSettingsCreateOrUpdate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/signin" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignInSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or Update Sign-In settings. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignInSettingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/signin$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/signin" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignInSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignInSettingsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSigninSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignInSettingsCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettings body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get Sign In Settings for the Portal + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignInSettingsGet(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/signin" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignInSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the SignInSettings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignInSettingsGetEntityTag(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/signin" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignInSettingsGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the SignInSettings. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignInSettingsGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/signin$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/signin" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignInSettingsGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignInSettingsGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignInSettingsGetEntityTag_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get Sign In Settings for the Portal + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignInSettingsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/signin$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/signin" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignInSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignInSettingsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSigninSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignInSettingsGet_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Update Sign-In settings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update Sign-In settings. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignInSettingsUpdate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettings body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/signin" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignInSettingsUpdate_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Update Sign-In settings. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update Sign-In settings. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignInSettingsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettings body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/signin$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/signin" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignInSettingsUpdate_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignInSettingsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update Sign-In settings. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignInSettingsUpdate_Validate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettings body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create or Update Sign-Up settings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignUpSettingsCreateOrUpdate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/signup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignUpSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or Update Sign-Up settings. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignUpSettingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/signup$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/signup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignUpSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignUpSettingsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSignupSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignUpSettingsCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettings body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get Sign Up Settings for the Portal + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignUpSettingsGet(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/signup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignUpSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the SignUpSettings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignUpSettingsGetEntityTag(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/signup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignUpSettingsGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the SignUpSettings. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignUpSettingsGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/signup$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/signup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignUpSettingsGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignUpSettingsGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignUpSettingsGetEntityTag_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get Sign Up Settings for the Portal + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignUpSettingsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/signup$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/signup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignUpSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignUpSettingsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSignupSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignUpSettingsGet_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Update Sign-Up settings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update Sign-Up settings. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignUpSettingsUpdate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettings body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/portalsettings/signup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignUpSettingsUpdate_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Update Sign-Up settings. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update Sign-Up settings. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SignUpSettingsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettings body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/portalsettings/signup$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/portalsettings/signup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SignUpSettingsUpdate_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignUpSettingsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update Sign-Up settings. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SignUpSettingsUpdate_Validate(string resourceGroupName, string serviceName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettings body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates the subscription of specified user to the specified product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionCreateOrUpdate(string resourceGroupName, string serviceName, string sid, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates the subscription of specified user to the specified product. + /// + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionCreateOrUpdateViaIdentity(global::System.String viaIdentity, bool? notify, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/subscriptions/" + + sid + + "?" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string sid, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(appType),appType); + await eventListener.AssertEnum(nameof(appType),appType,@"portal", @"developerPortal"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionDelete(string resourceGroupName, string serviceName, string sid, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified subscription. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/subscriptions/" + + sid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionDelete_Validate(string resourceGroupName, string serviceName, string sid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the specified Subscription entity. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionGet(string resourceGroupName, string serviceName, string sid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionGetEntityTag(string resourceGroupName, string serviceName, string sid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/subscriptions/" + + sid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionGetEntityTag_Validate(string resourceGroupName, string serviceName, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the specified Subscription entity. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/subscriptions/" + + sid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionGet_Validate(string resourceGroupName, string serviceName, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all subscriptions of the API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionList(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/subscriptions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified Subscription keys. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionListSecrets(string resourceGroupName, string serviceName, string sid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified Subscription keys. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionListSecretsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/subscriptions/(?[^/]+)/listSecrets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/subscriptions/" + + sid + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionListSecrets_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionKeysContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionListSecrets_Validate(string resourceGroupName, string serviceName, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all subscriptions of the API Management service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/subscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/subscriptions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionList_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Regenerates primary key of existing subscription of the API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionRegeneratePrimaryKey(string resourceGroupName, string serviceName, string sid, string subscriptionId, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "/regeneratePrimaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionRegeneratePrimaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Regenerates primary key of existing subscription of the API Management service instance. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionRegeneratePrimaryKeyViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/subscriptions/(?[^/]+)/regeneratePrimaryKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/subscriptions/" + + sid + + "/regeneratePrimaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionRegeneratePrimaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionRegeneratePrimaryKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionRegeneratePrimaryKey_Validate(string resourceGroupName, string serviceName, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Regenerates secondary key of existing subscription of the API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionRegenerateSecondaryKey(string resourceGroupName, string serviceName, string sid, string subscriptionId, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "/regenerateSecondaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionRegenerateSecondaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Regenerates secondary key of existing subscription of the API Management service instance. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionRegenerateSecondaryKeyViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/subscriptions/(?[^/]+)/regenerateSecondaryKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/subscriptions/" + + sid + + "/regenerateSecondaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionRegenerateSecondaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionRegenerateSecondaryKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionRegenerateSecondaryKey_Validate(string resourceGroupName, string serviceName, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of a subscription specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionUpdate(string resourceGroupName, string serviceName, string sid, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of a subscription specified by its identifier. + /// + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SubscriptionUpdateViaIdentity(global::System.String viaIdentity, bool? notify, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/subscriptions/" + + sid + + "?" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SubscriptionUpdate_Validate(string resourceGroupName, string serviceName, string sid, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(appType),appType); + await eventListener.AssertEnum(nameof(appType),appType,@"portal", @"developerPortal"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Adds an API to the specified tag via link. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagApiLinkCreateOrUpdate(string resourceGroupName, string serviceName, string tagId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagApiLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds an API to the specified tag via link. + /// + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagApiLinkCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagApiLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagApiLinkCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagApiLinkCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string tagId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified API from the specified tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagApiLinkDelete(string resourceGroupName, string serviceName, string tagId, string apiLinkId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagApiLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified API from the specified tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagApiLinkDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagApiLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagApiLinkDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagApiLinkDelete_Validate(string resourceGroupName, string serviceName, string tagId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the API link for the tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagApiLinkGet(string resourceGroupName, string serviceName, string tagId, string apiLinkId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagApiLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the API link for the tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagApiLinkGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagApiLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagApiLinkGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagApiLinkGet_Validate(string resourceGroupName, string serviceName, string tagId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the API links associated with a tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagApiLinkListByProduct(string resourceGroupName, string serviceName, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/apiLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagApiLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the API links associated with a tag. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagApiLinkListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/apiLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/apiLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/apiLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagApiLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagApiLinkListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagApiLinkListByProduct_Validate(string resourceGroupName, string serviceName, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Assign tag to the Api. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagAssignToApi(string resourceGroupName, string serviceName, string apiId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagAssignToApi_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Assign tag to the Api. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagAssignToApiViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagAssignToApi_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagAssignToApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagAssignToApi_Validate(string resourceGroupName, string serviceName, string apiId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Assign tag to the Operation. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagAssignToOperation(string resourceGroupName, string serviceName, string apiId, string operationId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagAssignToOperation_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Assign tag to the Operation. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagAssignToOperationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagAssignToOperation_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagAssignToOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagAssignToOperation_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Assign tag to the Product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagAssignToProduct(string resourceGroupName, string serviceName, string productId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagAssignToProduct_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Assign tag to the Product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagAssignToProductViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagAssignToProduct_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagAssignToProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagAssignToProduct_Validate(string resourceGroupName, string serviceName, string productId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagCreateOrUpdate(string resourceGroupName, string serviceName, string tagId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a tag. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string tagId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific tag of the API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagDelete(string resourceGroupName, string serviceName, string tagId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific tag of the API Management service instance. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagDelete_Validate(string resourceGroupName, string serviceName, string tagId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Detach the tag from the Api. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagDetachFromApi(string resourceGroupName, string serviceName, string apiId, string tagId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagDetachFromApi_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Detach the tag from the Api. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagDetachFromApiViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagDetachFromApi_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagDetachFromApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagDetachFromApi_Validate(string resourceGroupName, string serviceName, string apiId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Detach the tag from the Operation. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagDetachFromOperation(string resourceGroupName, string serviceName, string apiId, string operationId, string tagId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagDetachFromOperation_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Detach the tag from the Operation. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagDetachFromOperationViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagDetachFromOperation_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagDetachFromOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagDetachFromOperation_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Detach the tag from the Product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagDetachFromProduct(string resourceGroupName, string serviceName, string productId, string tagId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagDetachFromProduct_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Detach the tag from the Product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagDetachFromProductViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagDetachFromProduct_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagDetachFromProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagDetachFromProduct_Validate(string resourceGroupName, string serviceName, string productId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the tag specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGet(string resourceGroupName, string serviceName, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get tag associated with the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetByApi(string resourceGroupName, string serviceName, string apiId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get tag associated with the API. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetByApiViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetByApi_Validate(string resourceGroupName, string serviceName, string apiId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get tag associated with the Operation. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetByOperation(string resourceGroupName, string serviceName, string apiId, string operationId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get tag associated with the Operation. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetByOperationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetByOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetByOperation_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get tag associated with the Product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetByProduct(string resourceGroupName, string serviceName, string productId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get tag associated with the Product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetByProductViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetByProduct_Validate(string resourceGroupName, string serviceName, string productId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetEntityState(string resourceGroupName, string serviceName, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetEntityState_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetEntityStateByApi(string resourceGroupName, string serviceName, string apiId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetEntityStateByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetEntityStateByApiViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetEntityStateByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetEntityStateByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetEntityStateByApi_Validate(string resourceGroupName, string serviceName, string apiId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetEntityStateByOperation(string resourceGroupName, string serviceName, string apiId, string operationId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetEntityStateByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetEntityStateByOperationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetEntityStateByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetEntityStateByOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetEntityStateByOperation_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetEntityStateByProduct(string resourceGroupName, string serviceName, string productId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetEntityStateByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetEntityStateByProductViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetEntityStateByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetEntityStateByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetEntityStateByProduct_Validate(string resourceGroupName, string serviceName, string productId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetEntityStateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGetEntityState_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetEntityState_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGetEntityState_Validate(string resourceGroupName, string serviceName, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the tag specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagGet_Validate(string resourceGroupName, string serviceName, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all Tags associated with the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagListByApi(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/tags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all Tags associated with the API. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagListByApiViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/tags$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/tags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagListByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagListByApi_Validate(string resourceGroupName, string serviceName, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all Tags associated with the Operation. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagListByOperation(string resourceGroupName, string serviceName, string apiId, string operationId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/tags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagListByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all Tags associated with the Operation. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagListByOperationViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/tags$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/tags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagListByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagListByOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagListByOperation_Validate(string resourceGroupName, string serviceName, string apiId, string operationId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all Tags associated with the Product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagListByProduct(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/tags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all Tags associated with the Product. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/products/(?[^/]+)/tags$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/products/" + + productId + + "/tags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagListByProduct_Validate(string resourceGroupName, string serviceName, string productId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of tags defined within a service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Scope like 'apis', 'products' or 'apis/{apiId} + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string scope, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(scope) ? global::System.String.Empty : "scope=" + global::System.Uri.EscapeDataString(scope)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of tags defined within a service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Scope like 'apis', 'products' or 'apis/{apiId} + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(scope) ? global::System.String.Empty : "scope=" + global::System.Uri.EscapeDataString(scope)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Scope like 'apis', 'products' or 'apis/{apiId} + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string scope, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds an operation to the specified tag via link. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagOperationLinkCreateOrUpdate(string resourceGroupName, string serviceName, string tagId, string operationLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/operationLinks/" + + global::System.Uri.EscapeDataString(operationLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagOperationLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds an operation to the specified tag via link. + /// + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagOperationLinkCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/operationLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/operationLinks/{operationLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var operationLinkId = _match.Groups["operationLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/operationLinks/" + + operationLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagOperationLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagOperationLinkCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagOperationLinkCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string tagId, string operationLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationLinkId),operationLinkId); + await eventListener.AssertMinimumLength(nameof(operationLinkId),operationLinkId,1); + await eventListener.AssertMaximumLength(nameof(operationLinkId),operationLinkId,80); + await eventListener.AssertRegEx(nameof(operationLinkId),operationLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified operation from the specified tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagOperationLinkDelete(string resourceGroupName, string serviceName, string tagId, string operationLinkId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/operationLinks/" + + global::System.Uri.EscapeDataString(operationLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagOperationLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified operation from the specified tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagOperationLinkDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/operationLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/operationLinks/{operationLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var operationLinkId = _match.Groups["operationLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/operationLinks/" + + operationLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagOperationLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagOperationLinkDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagOperationLinkDelete_Validate(string resourceGroupName, string serviceName, string tagId, string operationLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationLinkId),operationLinkId); + await eventListener.AssertMinimumLength(nameof(operationLinkId),operationLinkId,1); + await eventListener.AssertMaximumLength(nameof(operationLinkId),operationLinkId,80); + await eventListener.AssertRegEx(nameof(operationLinkId),operationLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the operation link for the tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagOperationLinkGet(string resourceGroupName, string serviceName, string tagId, string operationLinkId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/operationLinks/" + + global::System.Uri.EscapeDataString(operationLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagOperationLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the operation link for the tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagOperationLinkGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/operationLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/operationLinks/{operationLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var operationLinkId = _match.Groups["operationLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/operationLinks/" + + operationLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagOperationLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagOperationLinkGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagOperationLinkGet_Validate(string resourceGroupName, string serviceName, string tagId, string operationLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationLinkId),operationLinkId); + await eventListener.AssertMinimumLength(nameof(operationLinkId),operationLinkId,1); + await eventListener.AssertMaximumLength(nameof(operationLinkId),operationLinkId,80); + await eventListener.AssertRegEx(nameof(operationLinkId),operationLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the operation links associated with a tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// operationId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagOperationLinkListByProduct(string resourceGroupName, string serviceName, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/operationLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagOperationLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the operation links associated with a tag. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// operationId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagOperationLinkListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/operationLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/operationLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/operationLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagOperationLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagOperationLinkListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// operationId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagOperationLinkListByProduct_Validate(string resourceGroupName, string serviceName, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds a product to the specified tag via link. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagProductLinkCreateOrUpdate(string resourceGroupName, string serviceName, string tagId, string productLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/productLinks/" + + global::System.Uri.EscapeDataString(productLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagProductLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds a product to the specified tag via link. + /// + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagProductLinkCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/productLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/productLinks/{productLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var productLinkId = _match.Groups["productLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/productLinks/" + + productLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagProductLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagProductLinkCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagProductLinkCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string tagId, string productLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productLinkId),productLinkId); + await eventListener.AssertMinimumLength(nameof(productLinkId),productLinkId,1); + await eventListener.AssertMaximumLength(nameof(productLinkId),productLinkId,80); + await eventListener.AssertRegEx(nameof(productLinkId),productLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified product from the specified tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagProductLinkDelete(string resourceGroupName, string serviceName, string tagId, string productLinkId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/productLinks/" + + global::System.Uri.EscapeDataString(productLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagProductLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified product from the specified tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagProductLinkDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/productLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/productLinks/{productLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var productLinkId = _match.Groups["productLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/productLinks/" + + productLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagProductLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagProductLinkDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagProductLinkDelete_Validate(string resourceGroupName, string serviceName, string tagId, string productLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productLinkId),productLinkId); + await eventListener.AssertMinimumLength(nameof(productLinkId),productLinkId,1); + await eventListener.AssertMaximumLength(nameof(productLinkId),productLinkId,80); + await eventListener.AssertRegEx(nameof(productLinkId),productLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the product link for the tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagProductLinkGet(string resourceGroupName, string serviceName, string tagId, string productLinkId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/productLinks/" + + global::System.Uri.EscapeDataString(productLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagProductLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the product link for the tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagProductLinkGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/productLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/productLinks/{productLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var productLinkId = _match.Groups["productLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/productLinks/" + + productLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagProductLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagProductLinkGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagProductLinkGet_Validate(string resourceGroupName, string serviceName, string tagId, string productLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productLinkId),productLinkId); + await eventListener.AssertMinimumLength(nameof(productLinkId),productLinkId,1); + await eventListener.AssertMaximumLength(nameof(productLinkId),productLinkId,80); + await eventListener.AssertRegEx(nameof(productLinkId),productLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the product links associated with a tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagProductLinkListByProduct(string resourceGroupName, string serviceName, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/productLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagProductLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the product links associated with a tag. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagProductLinkListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)/productLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}/productLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "/productLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagProductLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagProductLinkListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagProductLinkListByProduct_Validate(string resourceGroupName, string serviceName, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of resources associated with tags. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// aid | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, + /// ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| path + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + /// |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| isCurrent + /// | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagResourceListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tagResources" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagResourceListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of resources associated with tags. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// aid | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, + /// ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| path + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + /// |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| isCurrent + /// | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagResourceListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tagResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tagResources'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tagResources" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagResourceListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagResourceListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// aid | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, + /// ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| path + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + /// |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| isCurrent + /// | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagResourceListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the tag specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagUpdate(string resourceGroupName, string serviceName, string tagId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the tag specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TagUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TagUpdate_Validate(string resourceGroupName, string serviceName, string tagId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Update tenant access information details. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The identifier of the Access configuration. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to retrieve the Tenant Access Information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessCreate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(accessName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessCreate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Update tenant access information details. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Parameters supplied to retrieve the Tenant Access Information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessCreateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var accessName = _match.Groups["accessName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + accessName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessCreate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The identifier of the Access configuration. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to retrieve the Tenant Access Information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessCreate_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(accessName),accessName); + await eventListener.AssertEnum(nameof(accessName),accessName,@"access", @"gitAccess"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get tenant access information details without secrets. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessGet(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(accessName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Tenant access metadata + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessGetEntityTag(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(accessName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Tenant access metadata + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var accessName = _match.Groups["accessName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + accessName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessGetEntityTag_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(accessName),accessName); + await eventListener.AssertEnum(nameof(accessName),accessName,@"access", @"gitAccess"); + } + } + + /// Get tenant access information details without secrets. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var accessName = _match.Groups["accessName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + accessName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessGet_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(accessName),accessName); + await eventListener.AssertEnum(nameof(accessName),accessName,@"access", @"gitAccess"); + } + } + + /// Regenerate primary access key for GIT. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessGitRegeneratePrimaryKey(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(accessName) + + "/git/regeneratePrimaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessGitRegeneratePrimaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Regenerate primary access key for GIT. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessGitRegeneratePrimaryKeyViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)/git/regeneratePrimaryKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var accessName = _match.Groups["accessName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + accessName + + "/git/regeneratePrimaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessGitRegeneratePrimaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessGitRegeneratePrimaryKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessGitRegeneratePrimaryKey_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(accessName),accessName); + await eventListener.AssertEnum(nameof(accessName),accessName,@"access", @"gitAccess"); + } + } + + /// Regenerate secondary access key for GIT. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessGitRegenerateSecondaryKey(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(accessName) + + "/git/regenerateSecondaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessGitRegenerateSecondaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Regenerate secondary access key for GIT. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessGitRegenerateSecondaryKeyViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)/git/regenerateSecondaryKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var accessName = _match.Groups["accessName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + accessName + + "/git/regenerateSecondaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessGitRegenerateSecondaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessGitRegenerateSecondaryKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessGitRegenerateSecondaryKey_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(accessName),accessName); + await eventListener.AssertEnum(nameof(accessName),accessName,@"access", @"gitAccess"); + } + } + + /// Returns list of access infos - for Git and Management endpoints. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Not used + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessListByService(string resourceGroupName, string serviceName, string Filter, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns list of access infos - for Git and Management endpoints. + /// + /// Not used + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessListByServiceViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Not used + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessListByService_Validate(string resourceGroupName, string serviceName, string Filter, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get tenant access information details. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessListSecrets(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(accessName) + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get tenant access information details. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessListSecretsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)/listSecrets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var accessName = _match.Groups["accessName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + accessName + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessListSecrets_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationSecretsContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessListSecrets_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(accessName),accessName); + await eventListener.AssertEnum(nameof(accessName),accessName,@"access", @"gitAccess"); + } + } + + /// Regenerate primary access key + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessRegeneratePrimaryKey(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(accessName) + + "/regeneratePrimaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessRegeneratePrimaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Regenerate primary access key + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessRegeneratePrimaryKeyViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)/regeneratePrimaryKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var accessName = _match.Groups["accessName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + accessName + + "/regeneratePrimaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessRegeneratePrimaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessRegeneratePrimaryKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessRegeneratePrimaryKey_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(accessName),accessName); + await eventListener.AssertEnum(nameof(accessName),accessName,@"access", @"gitAccess"); + } + } + + /// Regenerate secondary access key + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessRegenerateSecondaryKey(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(accessName) + + "/regenerateSecondaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessRegenerateSecondaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Regenerate secondary access key + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessRegenerateSecondaryKeyViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)/regenerateSecondaryKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var accessName = _match.Groups["accessName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + accessName + + "/regenerateSecondaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessRegenerateSecondaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessRegenerateSecondaryKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// The identifier of the Access configuration. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessRegenerateSecondaryKey_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(accessName),accessName); + await eventListener.AssertEnum(nameof(accessName),accessName,@"access", @"gitAccess"); + } + } + + /// Update tenant access information details. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The identifier of the Access configuration. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to retrieve the Tenant Access Information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessUpdate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(accessName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Update tenant access information details. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Parameters supplied to retrieve the Tenant Access Information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantAccessUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var accessName = _match.Groups["accessName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + accessName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantAccessUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The identifier of the Access configuration. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Parameters supplied to retrieve the Tenant Access Information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantAccessUpdate_Validate(string resourceGroupName, string serviceName, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName accessName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(accessName),accessName); + await eventListener.AssertEnum(nameof(accessName),accessName,@"access", @"gitAccess"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// This operation applies changes from the specified Git branch to the configuration database. This is a long running operation + /// and could take several minutes to complete. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Deploy Configuration parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantConfigurationDeploy(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + var configurationName = @"configuration"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(configurationName) + + "/deploy" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantConfigurationDeploy_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This operation applies changes from the specified Git branch to the configuration database. This is a long running operation + /// and could take several minutes to complete. + /// + /// + /// Deploy Configuration parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantConfigurationDeployViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)/deploy$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var configurationName = _match.Groups["configurationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + configurationName + + "/deploy" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantConfigurationDeploy_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantConfigurationDeploy_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationResultContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Deploy Configuration parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantConfigurationDeploy_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Gets the status of the most recent synchronization between the configuration database and the Git repository. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantConfigurationGetSyncState(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + var configurationName = @"configuration"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(configurationName) + + "/syncState" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantConfigurationGetSyncState_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the status of the most recent synchronization between the configuration database and the Git repository. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantConfigurationGetSyncStateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)/syncState$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var configurationName = _match.Groups["configurationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + configurationName + + "/syncState" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantConfigurationGetSyncState_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantConfigurationGetSyncState_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantConfigurationSyncStateContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantConfigurationGetSyncState_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// This operation creates a commit with the current configuration snapshot to the specified branch in the repository. This + /// is a long running operation and could take several minutes to complete. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Save Configuration parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantConfigurationSave(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameter body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + var configurationName = @"configuration"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(configurationName) + + "/save" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantConfigurationSave_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This operation creates a commit with the current configuration snapshot to the specified branch in the repository. This + /// is a long running operation and could take several minutes to complete. + /// + /// + /// Save Configuration parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantConfigurationSaveViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameter body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)/save$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var configurationName = _match.Groups["configurationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + configurationName + + "/save" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantConfigurationSave_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantConfigurationSave_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationResultContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Save Configuration parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantConfigurationSave_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameter body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// This operation validates the changes in the specified Git branch. This is a long running operation and could take several + /// minutes to complete. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Validate Configuration parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantConfigurationValidate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + var configurationName = @"configuration"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/tenant/" + + global::System.Uri.EscapeDataString(configurationName) + + "/validate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantConfigurationValidate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This operation validates the changes in the specified Git branch. This is a long running operation and could take several + /// minutes to complete. + /// + /// + /// Validate Configuration parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantConfigurationValidateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/tenant/(?[^/]+)/validate$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var configurationName = _match.Groups["configurationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/tenant/" + + configurationName + + "/validate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantConfigurationValidate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantConfigurationValidate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationResultContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// Validate Configuration parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantConfigurationValidate_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get tenant settings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantSettingsGet(string resourceGroupName, string serviceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + var settingsType = @"public"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/settings/" + + global::System.Uri.EscapeDataString(settingsType) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get tenant settings. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantSettingsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/settings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings/{settingsType}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var settingsType = _match.Groups["settingsType"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/settings/" + + settingsType + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantSettingsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantSettingsContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantSettingsGet_Validate(string resourceGroupName, string serviceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Public settings. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Not used + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantSettingsListByService(string resourceGroupName, string serviceName, string Filter, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/settings" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantSettingsListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Public settings. + /// + /// Not used + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TenantSettingsListByServiceViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/settings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/settings" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TenantSettingsListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantSettingsListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantSettingsCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Not used + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TenantSettingsListByService_Validate(string resourceGroupName, string serviceName, string Filter, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Sends confirmation + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserConfirmationPasswordSend(string resourceGroupName, string serviceName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "/confirmations/password/send" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserConfirmationPasswordSend_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Sends confirmation + /// + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserConfirmationPasswordSendViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)/confirmations/password/send$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/confirmations/password/send'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "/confirmations/password/send" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserConfirmationPasswordSend_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserConfirmationPasswordSend_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserConfirmationPasswordSend_Validate(string resourceGroupName, string serviceName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(appType),appType); + await eventListener.AssertEnum(nameof(appType),appType,@"portal", @"developerPortal"); + } + } + + /// Creates or Updates a user. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// Send an Email notification to the User. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserCreateOrUpdate(string resourceGroupName, string serviceName, string userId, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or Updates a user. + /// + /// Send an Email notification to the User. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserCreateOrUpdateViaIdentity(global::System.String viaIdentity, bool? notify, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "?" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// Send an Email notification to the User. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string userId, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific user. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// Whether to delete user's subscription or not. + /// Send an Account Closed Email notification to the User. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserDelete(string resourceGroupName, string serviceName, string userId, bool? deleteSubscriptions, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + (null == deleteSubscriptions ? global::System.String.Empty : "deleteSubscriptions=" + global::System.Uri.EscapeDataString(deleteSubscriptions.ToString())) + + "&" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific user. + /// + /// Whether to delete user's subscription or not. + /// Send an Account Closed Email notification to the User. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserDeleteViaIdentity(global::System.String viaIdentity, bool? deleteSubscriptions, bool? notify, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "?" + + (null == deleteSubscriptions ? global::System.String.Empty : "deleteSubscriptions=" + global::System.Uri.EscapeDataString(deleteSubscriptions.ToString())) + + "&" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// Whether to delete user's subscription or not. + /// Send an Account Closed Email notification to the User. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserDelete_Validate(string resourceGroupName, string serviceName, string userId, bool? deleteSubscriptions, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(appType),appType); + await eventListener.AssertEnum(nameof(appType),appType,@"portal", @"developerPortal"); + } + } + + /// + /// Retrieves a redirection URL containing an authentication token for signing a given user into the developer portal. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserGenerateSsoUrl(string resourceGroupName, string serviceName, string userId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "/generateSsoUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserGenerateSsoUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Retrieves a redirection URL containing an authentication token for signing a given user into the developer portal. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserGenerateSsoUrlViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)/generateSsoUrl$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/generateSsoUrl'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "/generateSsoUrl" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserGenerateSsoUrl_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserGenerateSsoUrl_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GenerateSsoUrlResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserGenerateSsoUrl_Validate(string resourceGroupName, string serviceName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the user specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserGet(string resourceGroupName, string serviceName, string userId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the user specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserGetEntityTag(string resourceGroupName, string serviceName, string userId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the user specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserGetEntityTag_Validate(string resourceGroupName, string serviceName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the Shared Access Authorization Token for the User. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create Authorization Token parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserGetSharedAccessToken(string resourceGroupName, string serviceName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "/token" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserGetSharedAccessToken_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the Shared Access Authorization Token for the User. + /// + /// Create Authorization Token parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserGetSharedAccessTokenViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)/token$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/token'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "/token" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserGetSharedAccessToken_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserGetSharedAccessToken_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserTokenResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create Authorization Token parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserGetSharedAccessToken_Validate(string resourceGroupName, string serviceName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets the details of the user specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserGet_Validate(string resourceGroupName, string serviceName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all user groups. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|------------------------|-----------------------------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserGroupList(string resourceGroupName, string serviceName, string userId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "/groups" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserGroupList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all user groups. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|------------------------|-----------------------------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserGroupListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)/groups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/groups'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "/groups" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserGroupList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserGroupList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|------------------------|-----------------------------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserGroupList_Validate(string resourceGroupName, string serviceName, string userId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// List of all user identities. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserIdentitiesList(string resourceGroupName, string serviceName, string userId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "/identities" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserIdentitiesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List of all user identities. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserIdentitiesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)/identities$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/identities'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "/identities" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserIdentitiesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserIdentitiesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserIdentityCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserIdentitiesList_Validate(string resourceGroupName, string serviceName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of registered users in the specified service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| state | filter | eq | |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| groups | expand | | |
+ /// Number of records to return. + /// Number of records to skip. + /// Detailed Group in response. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? expandGroups, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == expandGroups ? global::System.String.Empty : "expandGroups=" + global::System.Uri.EscapeDataString(expandGroups.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of registered users in the specified service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| state | filter | eq | |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| groups | expand | | |
+ /// Number of records to return. + /// Number of records to skip. + /// Detailed Group in response. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, bool? expandGroups, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == expandGroups ? global::System.String.Empty : "expandGroups=" + global::System.Uri.EscapeDataString(expandGroups.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| state | filter | eq | |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| groups | expand | | |
+ /// Number of records to return. + /// Number of records to skip. + /// Detailed Group in response. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, bool? expandGroups, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the specified Subscription entity associated with a particular user. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserSubscriptionGet(string resourceGroupName, string serviceName, string userId, string sid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserSubscriptionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified Subscription entity associated with a particular user. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserSubscriptionGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "/subscriptions/" + + sid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserSubscriptionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserSubscriptionGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserSubscriptionGet_Validate(string resourceGroupName, string serviceName, string userId, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists the collection of subscriptions of the specified user. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|------------------------|-----------------------------------|
|name + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|displayName | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
|stateComment | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
|ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + /// |
|scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|userId | filter | + /// ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|productId | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserSubscriptionList(string resourceGroupName, string serviceName, string userId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "/subscriptions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserSubscriptionList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the collection of subscriptions of the specified user. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|------------------------|-----------------------------------|
|name + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|displayName | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
|stateComment | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
|ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + /// |
|scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|userId | filter | + /// ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|productId | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserSubscriptionListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)/subscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "/subscriptions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserSubscriptionList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserSubscriptionList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|------------------------|-----------------------------------|
|name + /// | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|displayName | filter | ge, le, + /// eq, ne, gt, lt | substringof, contains, startswith, endswith |
|stateComment | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
|ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + /// |
|scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|userId | filter | + /// ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|productId | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserSubscriptionList_Validate(string resourceGroupName, string serviceName, string userId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the user specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserUpdate(string resourceGroupName, string serviceName, string userId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the user specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UserUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/users/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UserUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// User identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UserUpdate_Validate(string resourceGroupName, string serviceName, string userId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Creates new or updates existing specified API of the workspace in an API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameter body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Creates new or updates existing specified API of the workspace in an API Management service instance. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameter body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameter body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Deletes the specified API of the workspace in an API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Delete all revisions of the Api. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiDelete(string resourceGroupName, string serviceName, string workspaceId, string apiId, bool? deleteRevisions, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + (null == deleteRevisions ? global::System.String.Empty : "deleteRevisions=" + global::System.Uri.EscapeDataString(deleteRevisions.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Deletes the specified API of the workspace in an API Management service instance. + /// + /// + /// Delete all revisions of the Api. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiDeleteViaIdentity(global::System.String viaIdentity, bool? deleteRevisions, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "?" + + (null == deleteRevisions ? global::System.String.Empty : "deleteRevisions=" + global::System.Uri.EscapeDataString(deleteRevisions.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Delete all revisions of the Api. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, bool? deleteRevisions, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid + /// for 5 minutes. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiExportGet(string resourceGroupName, string serviceName, string workspaceId, string apiId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var export = @"true"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "format=" + global::System.Uri.EscapeDataString(format) + + "&" + + "export=" + global::System.Uri.EscapeDataString(export) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiExportGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid + /// for 5 minutes. + /// + /// + /// Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiExportGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var export = @"true"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "?" + + "format=" + global::System.Uri.EscapeDataString(format) + + "&" + + "export=" + global::System.Uri.EscapeDataString(export) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiExportGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiExportGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiExportResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiExportGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"swagger-link", @"wsdl-link", @"wadl-link", @"openapi-link", @"openapi+json-link"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiGet(string resourceGroupName, string serviceName, string workspaceId, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the API specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the API specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all APIs of the workspace in an API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// isCurrent | filter | eq, ne | |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// Include full ApiVersionSet resource in response + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiListByService(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string tags, bool? expandApiVersionSet, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + (null == expandApiVersionSet ? global::System.String.Empty : "expandApiVersionSet=" + global::System.Uri.EscapeDataString(expandApiVersionSet.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all APIs of the workspace in an API Management service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// isCurrent | filter | eq, ne | |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// Include full ApiVersionSet resource in response + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string tags, bool? expandApiVersionSet, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + (null == expandApiVersionSet ? global::System.String.Empty : "expandApiVersionSet=" + global::System.Uri.EscapeDataString(expandApiVersionSet.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// isCurrent | filter | eq, ne | |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// Include full ApiVersionSet resource in response + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string tags, bool? expandApiVersionSet, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(tags),tags); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a new operation in the API or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new operation in the API or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified operation in the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationDelete(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified operation in the API. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the API Operation specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationGet(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API operation specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API operation specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the API Operation specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the operations for the specified API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationListByApi(string resourceGroupName, string serviceName, string workspaceId, string apiId, string Filter, int? Top, int? Skip, string tags, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the operations for the specified API. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationListByApiViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string tags, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationListByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, + /// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Include tags in the response. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationListByApi_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string Filter, int? Top, int? Skip, string tags, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(tags),tags); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates policy configuration for the API Operation level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates policy configuration for the API Operation level. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the policy configuration at the Api Operation. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyDelete(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the policy configuration at the Api Operation. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API Operation level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyGet(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API operation policy specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API operation policy specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API Operation level. + /// + /// Policy Export Format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/policies/" + + policyId + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the list of policy configuration at the API Operation level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyListByOperation(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationPolicyListByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the list of policy configuration at the API Operation level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyListByOperationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}/policies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations/" + + operationId + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationPolicyListByOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyListByOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationPolicyListByOperation_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the operation in the API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Operation Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationUpdate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the operation in the API specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// API Operation Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiOperationUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/operations/{operationId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var operationId = _match.Groups["operationId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiOperationUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Operation Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiOperationUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string operationId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + await eventListener.AssertMaximumLength(nameof(operationId),operationId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates policy configuration for the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiPolicyCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates policy configuration for the API. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiPolicyCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiPolicyCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiPolicyCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the policy configuration at the Api. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiPolicyDelete(string resourceGroupName, string serviceName, string workspaceId, string apiId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the policy configuration at the Api. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiPolicyDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiPolicyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiPolicyDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiPolicyGet(string resourceGroupName, string serviceName, string workspaceId, string apiId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API policy specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiPolicyGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the API policy specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiPolicyGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiPolicyGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiPolicyGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API level. + /// + /// Policy Export Format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiPolicyGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/policies/" + + policyId + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiPolicyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiPolicyGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiPolicyListByApi(string resourceGroupName, string serviceName, string workspaceId, string apiId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiPolicyListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the policy configuration at the API level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiPolicyListByApiViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/policies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiPolicyListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiPolicyListByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiPolicyListByApi_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a new Release for the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string releaseId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases/" + + global::System.Uri.EscapeDataString(releaseId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new Release for the API. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/releases/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/releases/{releaseId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var releaseId = _match.Groups["releaseId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/releases/" + + releaseId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string releaseId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(releaseId),releaseId); + await eventListener.AssertMinimumLength(nameof(releaseId),releaseId,1); + await eventListener.AssertMaximumLength(nameof(releaseId),releaseId,80); + await eventListener.AssertRegEx(nameof(releaseId),releaseId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified release in the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseDelete(string resourceGroupName, string serviceName, string workspaceId, string apiId, string releaseId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases/" + + global::System.Uri.EscapeDataString(releaseId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified release in the API. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/releases/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/releases/{releaseId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var releaseId = _match.Groups["releaseId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/releases/" + + releaseId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string releaseId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(releaseId),releaseId); + await eventListener.AssertMinimumLength(nameof(releaseId),releaseId,1); + await eventListener.AssertMaximumLength(nameof(releaseId),releaseId,80); + await eventListener.AssertRegEx(nameof(releaseId),releaseId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Returns the details of an API release. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseGet(string resourceGroupName, string serviceName, string workspaceId, string apiId, string releaseId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases/" + + global::System.Uri.EscapeDataString(releaseId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the etag of an API release. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string apiId, string releaseId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases/" + + global::System.Uri.EscapeDataString(releaseId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the etag of an API release. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/releases/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/releases/{releaseId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var releaseId = _match.Groups["releaseId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/releases/" + + releaseId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string releaseId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(releaseId),releaseId); + await eventListener.AssertMinimumLength(nameof(releaseId),releaseId,1); + await eventListener.AssertMaximumLength(nameof(releaseId),releaseId,80); + await eventListener.AssertRegEx(nameof(releaseId),releaseId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Returns the details of an API release. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/releases/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/releases/{releaseId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var releaseId = _match.Groups["releaseId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/releases/" + + releaseId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string releaseId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(releaseId),releaseId); + await eventListener.AssertMinimumLength(nameof(releaseId),releaseId,1); + await eventListener.AssertMaximumLength(nameof(releaseId),releaseId,80); + await eventListener.AssertRegEx(nameof(releaseId),releaseId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists all releases of an API. An API release is created when making an API Revision current. Releases are also used to + /// rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip parameters. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseListByService(string resourceGroupName, string serviceName, string workspaceId, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all releases of an API. An API release is created when making an API Revision current. Releases are also used to + /// rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip parameters. + /// + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/releases$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/releases'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/releases" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the release of the API specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Release Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseUpdate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string releaseId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/releases/" + + global::System.Uri.EscapeDataString(releaseId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the release of the API specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// API Release Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiReleaseUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/releases/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/releases/{releaseId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var releaseId = _match.Groups["releaseId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/releases/" + + releaseId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiReleaseUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Release Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiReleaseUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string releaseId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(releaseId),releaseId); + await eventListener.AssertMinimumLength(nameof(releaseId),releaseId,1); + await eventListener.AssertMaximumLength(nameof(releaseId),releaseId,80); + await eventListener.AssertRegEx(nameof(releaseId),releaseId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Lists all revisions of an API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiRevisionListByService(string resourceGroupName, string serviceName, string workspaceId, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/revisions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiRevisionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all revisions of an API. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiRevisionListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/revisions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/revisions'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/revisions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiRevisionListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiRevisionListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiRevisionCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiRevisionListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,80); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates schema configuration for the API. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The schema contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiSchemaCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string schemaId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiSchemaCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates schema configuration for the API. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The schema contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiSchemaCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiSchemaCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiSchemaCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The schema contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiSchemaCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string schemaId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the schema configuration at the Api. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// If true removes all references to the schema before deleting it. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiSchemaDelete(string resourceGroupName, string serviceName, string workspaceId, string apiId, string schemaId, bool? force, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + (null == force ? global::System.String.Empty : "force=" + global::System.Uri.EscapeDataString(force.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiSchemaDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the schema configuration at the Api. + /// + /// If true removes all references to the schema before deleting it. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiSchemaDeleteViaIdentity(global::System.String viaIdentity, bool? force, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/schemas/" + + schemaId + + "?" + + (null == force ? global::System.String.Empty : "force=" + global::System.Uri.EscapeDataString(force.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiSchemaDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiSchemaDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// If true removes all references to the schema before deleting it. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiSchemaDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string schemaId, bool? force, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the schema configuration at the API level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiSchemaGet(string resourceGroupName, string serviceName, string workspaceId, string apiId, string schemaId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiSchemaGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the schema specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiSchemaGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string apiId, string schemaId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiSchemaGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the schema specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiSchemaGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiSchemaGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiSchemaGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiSchemaGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string schemaId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the schema configuration at the API level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiSchemaGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiSchemaGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiSchemaGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiSchemaGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string schemaId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the schema configuration at the API level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiSchemaListByApi(string resourceGroupName, string serviceName, string workspaceId, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "/schemas" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiSchemaListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the schema configuration at the API level. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiSchemaListByApiViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)/schemas$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/schemas'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "/schemas" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiSchemaListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiSchemaListByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiSchemaListByApi_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Updates the specified API of the workspace in an API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Update Contract parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiUpdate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apis/" + + global::System.Uri.EscapeDataString(apiId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Updates the specified API of the workspace in an API Management service instance. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// API Update Contract parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apis/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var apiId = _match.Groups["apiId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apis/" + + apiId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// API revision identifier. Must be unique in the current API Management service instance. Non-current + /// revision has ;rev=n as a suffix where n is the revision number. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// API Update Contract parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string apiId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiId),apiId); + await eventListener.AssertMinimumLength(nameof(apiId),apiId,1); + await eventListener.AssertMaximumLength(nameof(apiId),apiId,256); + await eventListener.AssertRegEx(nameof(apiId),apiId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or Updates a Api Version Set. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string versionSetId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apiVersionSets/" + + global::System.Uri.EscapeDataString(versionSetId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or Updates a Api Version Set. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apiVersionSets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apiVersionSets/{versionSetId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var versionSetId = _match.Groups["versionSetId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apiVersionSets/" + + versionSetId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string versionSetId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(versionSetId),versionSetId); + await eventListener.AssertMinimumLength(nameof(versionSetId),versionSetId,1); + await eventListener.AssertMaximumLength(nameof(versionSetId),versionSetId,80); + await eventListener.AssertRegEx(nameof(versionSetId),versionSetId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific Api Version Set. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetDelete(string resourceGroupName, string serviceName, string workspaceId, string versionSetId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apiVersionSets/" + + global::System.Uri.EscapeDataString(versionSetId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific Api Version Set. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apiVersionSets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apiVersionSets/{versionSetId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var versionSetId = _match.Groups["versionSetId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apiVersionSets/" + + versionSetId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string versionSetId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(versionSetId),versionSetId); + await eventListener.AssertMinimumLength(nameof(versionSetId),versionSetId,1); + await eventListener.AssertMaximumLength(nameof(versionSetId),versionSetId,80); + await eventListener.AssertRegEx(nameof(versionSetId),versionSetId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Api Version Set specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetGet(string resourceGroupName, string serviceName, string workspaceId, string versionSetId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apiVersionSets/" + + global::System.Uri.EscapeDataString(versionSetId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string versionSetId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apiVersionSets/" + + global::System.Uri.EscapeDataString(versionSetId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apiVersionSets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apiVersionSets/{versionSetId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var versionSetId = _match.Groups["versionSetId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apiVersionSets/" + + versionSetId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string versionSetId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(versionSetId),versionSetId); + await eventListener.AssertMinimumLength(nameof(versionSetId),versionSetId,1); + await eventListener.AssertMaximumLength(nameof(versionSetId),versionSetId,80); + await eventListener.AssertRegEx(nameof(versionSetId),versionSetId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Api Version Set specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apiVersionSets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apiVersionSets/{versionSetId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var versionSetId = _match.Groups["versionSetId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apiVersionSets/" + + versionSetId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string versionSetId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(versionSetId),versionSetId); + await eventListener.AssertMinimumLength(nameof(versionSetId),versionSetId,1); + await eventListener.AssertMaximumLength(nameof(versionSetId),versionSetId,80); + await eventListener.AssertRegEx(nameof(versionSetId),versionSetId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists a collection of API Version Sets in the specified workspace with a service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetListByService(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apiVersionSets" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists a collection of API Version Sets in the specified workspace with a service instance. + /// + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apiVersionSets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apiVersionSets'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apiVersionSets" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the Api VersionSet specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetUpdate(string resourceGroupName, string serviceName, string workspaceId, string versionSetId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/apiVersionSets/" + + global::System.Uri.EscapeDataString(versionSetId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the Api VersionSet specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceApiVersionSetUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/apiVersionSets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/apiVersionSets/{versionSetId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var versionSetId = _match.Groups["versionSetId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/apiVersionSets/" + + versionSetId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceApiVersionSetUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceApiVersionSetUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string versionSetId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(versionSetId),versionSetId); + await eventListener.AssertMinimumLength(nameof(versionSetId),versionSetId,1); + await eventListener.AssertMaximumLength(nameof(versionSetId),versionSetId,80); + await eventListener.AssertRegEx(nameof(versionSetId),versionSetId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates a new workspace or updates an existing one. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a new workspace or updates an existing one. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WorkspaceContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WorkspaceContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified workspace. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceDelete(string resourceGroupName, string serviceName, string workspaceId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified workspace. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the workspace specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGet(string resourceGroupName, string serviceName, string workspaceId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the workspace specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the workspace specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the workspace specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WorkspaceContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Creates new or updates existing specified Schema of the workspace in an API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string schemaId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGlobalSchemaCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Creates new or updates existing specified Schema of the workspace in an API Management service instance. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGlobalSchemaCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GlobalSchemaContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string schemaId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific Schema. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaDelete(string resourceGroupName, string serviceName, string workspaceId, string schemaId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGlobalSchemaDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific Schema. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGlobalSchemaDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string schemaId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Schema specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaGet(string resourceGroupName, string serviceName, string workspaceId, string schemaId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGlobalSchemaGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the Schema specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string schemaId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/schemas/" + + global::System.Uri.EscapeDataString(schemaId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGlobalSchemaGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the Schema specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGlobalSchemaGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string schemaId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Schema specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/schemas/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/schemas/{schemaId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var schemaId = _match.Groups["schemaId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/schemas/" + + schemaId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGlobalSchemaGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GlobalSchemaContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Schema id identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string schemaId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(schemaId),schemaId); + await eventListener.AssertMinimumLength(nameof(schemaId),schemaId,1); + await eventListener.AssertMaximumLength(nameof(schemaId),schemaId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of schemas registered with workspace in a service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaListByService(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/schemas" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGlobalSchemaListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of schemas registered with workspace in a service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/schemas$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/schemas'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/schemas" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGlobalSchemaListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GlobalSchemaCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGlobalSchemaListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or Updates a group. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or Updates a group. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific group of the workspace in an API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupDelete(string resourceGroupName, string serviceName, string workspaceId, string groupId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific group of the workspace in an API Management service instance. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the group specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupGet(string resourceGroupName, string serviceName, string workspaceId, string groupId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the group specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string groupId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of the group specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the group specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of groups defined within a workspace in a service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| externalId | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupListByService(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/groups" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of groups defined within a workspace in a service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| externalId | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/groups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/groups'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/groups" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| externalId | filter | eq | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the group specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupUpdate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the group specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/groups/{groupId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/groups/" + + groupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Checks that user entity specified by identifier is associated with the group entity. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupUserCheckEntityExists(string resourceGroupName, string serviceName, string workspaceId, string groupId, string userId, string subscriptionId, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupUserCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// + /// Checks that user entity specified by identifier is associated with the group entity. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupUserCheckEntityExistsViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/groups/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/groups/{groupId}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var groupId = _match.Groups["groupId"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/groups/" + + groupId + + "/users/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupUserCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupUserCheckEntityExists_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + case global::System.Net.HttpStatusCode.NotFound: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNotFound(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupUserCheckEntityExists_Validate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Add existing user to existing group + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupUserCreate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string userId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupUserCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Add existing user to existing group + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupUserCreateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/groups/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/groups/{groupId}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var groupId = _match.Groups["groupId"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/groups/" + + groupId + + "/users/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupUserCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupUserCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupUserCreate_Validate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Remove existing user from existing group. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupUserDelete(string resourceGroupName, string serviceName, string workspaceId, string groupId, string userId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupUserDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Remove existing user from existing group. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupUserDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/groups/(?[^/]+)/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/groups/{groupId}/users/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var groupId = _match.Groups["groupId"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/groups/" + + groupId + + "/users/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupUserDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupUserDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupUserDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of user entities associated with the group. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupUserList(string resourceGroupName, string serviceName, string workspaceId, string groupId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/users" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupUserList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of user entities associated with the group. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceGroupUserListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/groups/(?[^/]+)/users$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/groups/{groupId}/users'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var groupId = _match.Groups["groupId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/groups/" + + groupId + + "/users" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceGroupUserList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupUserList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Group identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + /// endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | + /// substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceGroupUserList_Validate(string resourceGroupName, string serviceName, string workspaceId, string groupId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertMinimumLength(nameof(groupId),groupId,1); + await eventListener.AssertMaximumLength(nameof(groupId),groupId,256); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all workspaces of the API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |

| description | + /// filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceListByService(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all workspaces of the API Management service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |

| description | + /// filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WorkspaceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |

| description | + /// filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceListByService_Validate(string resourceGroupName, string serviceName, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates named value. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates named value. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/namedValues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/namedValues/{namedValueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/namedValues/" + + namedValueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Deletes specific named value from the workspace in an API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueDelete(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Deletes specific named value from the workspace in an API Management service instance. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/namedValues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/namedValues/{namedValueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/namedValues/" + + namedValueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the named value specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueGet(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the named value specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the named value specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/namedValues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/namedValues/{namedValueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/namedValues/" + + namedValueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the named value specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/namedValues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/namedValues/{namedValueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/namedValues/" + + namedValueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists a collection of named values defined within a workspace in a service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all |
| displayName | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Query parameter to fetch named value entities based on refresh status. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueListByService(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState? isKeyVaultRefreshFailed, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/namedValues" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(isKeyVaultRefreshFailed) ? global::System.String.Empty : "isKeyVaultRefreshFailed=" + global::System.Uri.EscapeDataString(isKeyVaultRefreshFailed)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists a collection of named values defined within a workspace in a service instance. + /// + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all |
| displayName | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Query parameter to fetch named value entities based on refresh status. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState? isKeyVaultRefreshFailed, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/namedValues$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/namedValues'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/namedValues" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(isKeyVaultRefreshFailed) ? global::System.String.Empty : "isKeyVaultRefreshFailed=" + global::System.Uri.EscapeDataString(isKeyVaultRefreshFailed)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all |
| displayName | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Query parameter to fetch named value entities based on refresh status. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState? isKeyVaultRefreshFailed, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(isKeyVaultRefreshFailed),isKeyVaultRefreshFailed); + await eventListener.AssertEnum(nameof(isKeyVaultRefreshFailed),isKeyVaultRefreshFailed,@"true", @"false"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the secret of the named value specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueListValue(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "/listValue" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueListValue_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the secret of the named value specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueListValueViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/namedValues/(?[^/]+)/listValue$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/namedValues/{namedValueId}/listValue'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/namedValues/" + + namedValueId + + "/listValue" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueListValue_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueListValue_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueSecretContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueListValue_Validate(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Refresh the secret of the named value specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueRefreshSecret(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "/refreshSecret" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueRefreshSecret_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Refresh the secret of the named value specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueRefreshSecretViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/namedValues/(?[^/]+)/refreshSecret$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/namedValues/{namedValueId}/refreshSecret'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/namedValues/" + + namedValueId + + "/refreshSecret" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueRefreshSecret_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueRefreshSecret_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueRefreshSecret_Validate(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the specific named value. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueUpdate(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/namedValues/" + + global::System.Uri.EscapeDataString(namedValueId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the specific named value. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNamedValueUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/namedValues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/namedValues/{namedValueId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var namedValueId = _match.Groups["namedValueId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/namedValues/" + + namedValueId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNamedValueUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Identifier of the NamedValue. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNamedValueUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string namedValueId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(namedValueId),namedValueId); + await eventListener.AssertMaximumLength(nameof(namedValueId),namedValueId,256); + await eventListener.AssertRegEx(nameof(namedValueId),namedValueId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create or Update API Management publisher notification for the workspace. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string ifMatch, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or Update API Management publisher notification for the workspace. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications/" + + notificationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NotificationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the Notification specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationGet(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the details of the Notification specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications/" + + notificationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NotificationContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationGet_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of properties defined within a service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationListByService(string resourceGroupName, string serviceName, string workspaceId, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications" + + "?" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of properties defined within a service instance. + /// + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationListByServiceViaIdentity(global::System.String viaIdentity, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications" + + "?" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NotificationCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Determine if Notification Recipient Email subscribed to the notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailCheckEntityExists(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientEmails/" + + global::System.Uri.EscapeDataString(email) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientEmailCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// Determine if Notification Recipient Email subscribed to the notification. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailCheckEntityExistsViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications/(?[^/]+)/recipientEmails/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientEmails/{email}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var email = _match.Groups["email"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications/" + + notificationName + + "/recipientEmails/" + + email + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientEmailCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailCheckEntityExists_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + case global::System.Net.HttpStatusCode.NotFound: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNotFound(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailCheckEntityExists_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(email),email); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds the Email address to the list of Recipients for the Notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientEmails/" + + global::System.Uri.EscapeDataString(email) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientEmailCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds the Email address to the list of Recipients for the Notification. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailCreateOrUpdateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications/(?[^/]+)/recipientEmails/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientEmails/{email}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var email = _match.Groups["email"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications/" + + notificationName + + "/recipientEmails/" + + email + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientEmailCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientEmailContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientEmailContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(email),email); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Removes the email from the list of Notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailDelete(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientEmails/" + + global::System.Uri.EscapeDataString(email) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientEmailDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Removes the email from the list of Notification. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications/(?[^/]+)/recipientEmails/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientEmails/{email}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var email = _match.Groups["email"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications/" + + notificationName + + "/recipientEmails/" + + email + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientEmailDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// Email identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string email, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(email),email); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the list of the Notification Recipient Emails subscribed to a notification. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailListByNotification(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientEmails" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientEmailListByNotification_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the list of the Notification Recipient Emails subscribed to a notification. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailListByNotificationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications/(?[^/]+)/recipientEmails$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientEmails'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications/" + + notificationName + + "/recipientEmails" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientEmailListByNotification_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailListByNotification_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientEmailCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the + /// actual call, but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientEmailListByNotification_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Determine if the Notification Recipient User is subscribed to the notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserCheckEntityExists(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientUsers/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientUserCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// Determine if the Notification Recipient User is subscribed to the notification. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserCheckEntityExistsViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications/(?[^/]+)/recipientUsers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientUsers/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications/" + + notificationName + + "/recipientUsers/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientUserCheckEntityExists_Call(request,onNoContent,onNotFound,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 404 (NotFound). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserCheckEntityExists_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + case global::System.Net.HttpStatusCode.NotFound: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNotFound(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserCheckEntityExists_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds the API Management User to the list of Recipients for the Notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientUsers/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientUserCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds the API Management User to the list of Recipients for the Notification. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserCreateOrUpdateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications/(?[^/]+)/recipientUsers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientUsers/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications/" + + notificationName + + "/recipientUsers/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientUserCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientUserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientUserContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Removes the API Management user from the list of Notification. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserDelete(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientUsers/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientUserDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Removes the API Management user from the list of Notification. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications/(?[^/]+)/recipientUsers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientUsers/{userId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var userId = _match.Groups["userId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications/" + + notificationName + + "/recipientUsers/" + + userId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientUserDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// User identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string userId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(userId),userId); + await eventListener.AssertMinimumLength(nameof(userId),userId,1); + await eventListener.AssertMaximumLength(nameof(userId),userId,80); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Gets the list of the Notification Recipient User subscribed to the notification. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserListByNotification(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/notifications/" + + global::System.Uri.EscapeDataString(notificationName) + + "/recipientUsers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientUserListByNotification_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the list of the Notification Recipient User subscribed to the notification. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserListByNotificationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/notifications/(?[^/]+)/recipientUsers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/notifications/{notificationName}/recipientUsers'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var notificationName = _match.Groups["notificationName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/notifications/" + + notificationName + + "/recipientUsers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceNotificationRecipientUserListByNotification_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserListByNotification_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientUserCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Notification Name Identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceNotificationRecipientUserListByNotification_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName notificationName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(notificationName),notificationName); + await eventListener.AssertEnum(nameof(notificationName),notificationName,@"RequestPublisherNotificationMessage", @"PurchasePublisherNotificationMessage", @"NewApplicationNotificationMessage", @"BCC", @"NewIssuePublisherNotificationMessage", @"AccountClosedPublisher", @"QuotaLimitApproachingPublisherNotificationMessage"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates policy configuration for the workspace. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates policy configuration for the workspace. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the policy configuration at the workspace. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyDelete(string resourceGroupName, string serviceName, string workspaceId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the policy configuration at the workspace. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates a policy fragment. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// A resource identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy fragment contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string id, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policyFragments/" + + global::System.Uri.EscapeDataString(id) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates a policy fragment. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy fragment contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policyFragments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policyFragments/{id}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var id = _match.Groups["id"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policyFragments/" + + id + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyFragmentContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// A resource identifier. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy fragment contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string id, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(id),id); + await eventListener.AssertMinimumLength(nameof(id),id,1); + await eventListener.AssertMaximumLength(nameof(id),id,80); + await eventListener.AssertRegEx(nameof(id),id,@"(^[\w]+$)|(^[\w][\w\-]+[\w]$)"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a policy fragment. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// A resource identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentDelete(string resourceGroupName, string serviceName, string workspaceId, string id, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policyFragments/" + + global::System.Uri.EscapeDataString(id) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a policy fragment. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policyFragments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policyFragments/{id}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var id = _match.Groups["id"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policyFragments/" + + id + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// A resource identifier. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string id, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(id),id); + await eventListener.AssertMinimumLength(nameof(id),id,1); + await eventListener.AssertMaximumLength(nameof(id),id,80); + await eventListener.AssertRegEx(nameof(id),id,@"(^[\w]+$)|(^[\w][\w\-]+[\w]$)"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets a policy fragment. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// Policy fragment content format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentGet(string resourceGroupName, string serviceName, string workspaceId, string id, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policyFragments/" + + global::System.Uri.EscapeDataString(id) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of a policy fragment. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string id, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policyFragments/" + + global::System.Uri.EscapeDataString(id) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state (Etag) version of a policy fragment. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policyFragments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policyFragments/{id}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var id = _match.Groups["id"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policyFragments/" + + id + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string id, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(id),id); + await eventListener.AssertMinimumLength(nameof(id),id,1); + await eventListener.AssertMaximumLength(nameof(id),id,80); + await eventListener.AssertRegEx(nameof(id),id,@"(^[\w]+$)|(^[\w][\w\-]+[\w]$)"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets a policy fragment. + /// + /// Policy fragment content format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policyFragments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policyFragments/{id}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var id = _match.Groups["id"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policyFragments/" + + id + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyFragmentContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// Policy fragment content format. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string id, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? format, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(id),id); + await eventListener.AssertMinimumLength(nameof(id),id,1); + await eventListener.AssertMaximumLength(nameof(id),id,80); + await eventListener.AssertRegEx(nameof(id),id,@"(^[\w]+$)|(^[\w][\w\-]+[\w]$)"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + } + } + + /// Gets all policy fragments defined within a workspace. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| value | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// OData order by query option. + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentListByService(string resourceGroupName, string serviceName, string workspaceId, string subscriptionId, string Filter, string Orderby, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policyFragments" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all policy fragments defined within a workspace. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| value | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// OData order by query option. + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentListByServiceViaIdentity(global::System.String viaIdentity, string Filter, string Orderby, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policyFragments$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policyFragments'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policyFragments" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyFragmentCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter + /// | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| value | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
+ /// OData order by query option. + /// Number of records to return. + /// Number of records to skip. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, string subscriptionId, string Filter, string Orderby, int? Top, int? Skip, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(Orderby),Orderby); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + } + } + + /// Lists policy resources that reference the policy fragment. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentListReferences(string resourceGroupName, string serviceName, string workspaceId, string id, string subscriptionId, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policyFragments/" + + global::System.Uri.EscapeDataString(id) + + "/listReferences" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentListReferences_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists policy resources that reference the policy fragment. + /// + /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyFragmentListReferencesViaIdentity(global::System.String viaIdentity, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policyFragments/(?[^/]+)/listReferences$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policyFragments/{id}/listReferences'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var id = _match.Groups["id"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policyFragments/" + + id + + "/listReferences" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyFragmentListReferences_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentListReferences_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// A resource identifier. + /// The ID of the target subscription. The value must be an UUID. + /// Number of records to return. + /// Number of records to skip. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyFragmentListReferences_Validate(string resourceGroupName, string serviceName, string workspaceId, string id, string subscriptionId, int? Top, int? Skip, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(id),id); + await eventListener.AssertMinimumLength(nameof(id),id,1); + await eventListener.AssertMaximumLength(nameof(id),id,80); + await eventListener.AssertRegEx(nameof(id),id,@"(^[\w]+$)|(^[\w][\w\-]+[\w]$)"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + } + } + + /// Get the policy configuration at the API level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyGet(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the workspace policy specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the workspace policy specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the API level. + /// + /// Policy Export Format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policies/" + + policyId + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyGet_Validate(string resourceGroupName, string serviceName, string workspaceId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the workspace level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyListByApi(string resourceGroupName, string serviceName, string workspaceId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the policy configuration at the workspace level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspacePolicyListByApiViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/policies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspacePolicyListByApi_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyListByApi_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspacePolicyListByApi_Validate(string resourceGroupName, string serviceName, string workspaceId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds an API to the specified product via link. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductApiLinkCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string productId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductApiLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds an API to the specified product via link. + /// + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductApiLinkCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductApiLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductApiLinkCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductApiLinkCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified API from the specified product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductApiLinkDelete(string resourceGroupName, string serviceName, string workspaceId, string productId, string apiLinkId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductApiLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified API from the specified product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductApiLinkDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductApiLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductApiLinkDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductApiLinkDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the API link for the product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductApiLinkGet(string resourceGroupName, string serviceName, string workspaceId, string productId, string apiLinkId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductApiLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the API link for the product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductApiLinkGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductApiLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductApiLinkGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductApiLinkGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the API links associated with a product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductApiLinkListByProduct(string resourceGroupName, string serviceName, string workspaceId, string productId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/apiLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductApiLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the API links associated with a product. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductApiLinkListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/apiLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/apiLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/apiLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductApiLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductApiLinkListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductApiLinkListByProduct_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or Updates a product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or Updates a product. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Delete existing subscriptions associated with the product or not. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductDelete(string resourceGroupName, string serviceName, string workspaceId, string productId, string ifMatch, bool? deleteSubscriptions, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "?" + + (null == deleteSubscriptions ? global::System.String.Empty : "deleteSubscriptions=" + global::System.Uri.EscapeDataString(deleteSubscriptions.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete product. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Delete existing subscriptions associated with the product or not. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, bool? deleteSubscriptions, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "?" + + (null == deleteSubscriptions ? global::System.String.Empty : "deleteSubscriptions=" + global::System.Uri.EscapeDataString(deleteSubscriptions.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Delete existing subscriptions associated with the product or not. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string ifMatch, bool? deleteSubscriptions, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the product specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGet(string resourceGroupName, string serviceName, string workspaceId, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the product specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the product specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the product specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds a group to the specified product via link. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string productId, string groupLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groupLinks/" + + global::System.Uri.EscapeDataString(groupLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGroupLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds a group to the specified product via link. + /// + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/groupLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/groupLinks/{groupLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var groupLinkId = _match.Groups["groupLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/groupLinks/" + + groupLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGroupLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string groupLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(groupLinkId),groupLinkId); + await eventListener.AssertMinimumLength(nameof(groupLinkId),groupLinkId,1); + await eventListener.AssertMaximumLength(nameof(groupLinkId),groupLinkId,80); + await eventListener.AssertRegEx(nameof(groupLinkId),groupLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified group from the specified product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkDelete(string resourceGroupName, string serviceName, string workspaceId, string productId, string groupLinkId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groupLinks/" + + global::System.Uri.EscapeDataString(groupLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGroupLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified group from the specified product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/groupLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/groupLinks/{groupLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var groupLinkId = _match.Groups["groupLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/groupLinks/" + + groupLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGroupLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string groupLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(groupLinkId),groupLinkId); + await eventListener.AssertMinimumLength(nameof(groupLinkId),groupLinkId,1); + await eventListener.AssertMaximumLength(nameof(groupLinkId),groupLinkId,80); + await eventListener.AssertRegEx(nameof(groupLinkId),groupLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the group link for the product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkGet(string resourceGroupName, string serviceName, string workspaceId, string productId, string groupLinkId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groupLinks/" + + global::System.Uri.EscapeDataString(groupLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGroupLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the group link for the product. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/groupLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/groupLinks/{groupLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var groupLinkId = _match.Groups["groupLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/groupLinks/" + + groupLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGroupLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string groupLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(groupLinkId),groupLinkId); + await eventListener.AssertMinimumLength(nameof(groupLinkId),groupLinkId,1); + await eventListener.AssertMaximumLength(nameof(groupLinkId),groupLinkId,80); + await eventListener.AssertRegEx(nameof(groupLinkId),groupLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the group links associated with a product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// groupId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkListByProduct(string resourceGroupName, string serviceName, string workspaceId, string productId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/groupLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGroupLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the group links associated with a product. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// groupId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/groupLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/groupLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/groupLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductGroupLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// groupId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductGroupLinkListByProduct_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Lists a collection of products in the specified workspace in a service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| state | filter | eq | |
| groups | expand | | |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains an array of groups that have visibility to the product. + /// The default is false. + /// Products which are part of a specific tag. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductListByService(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, bool? expandGroups, string tags, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == expandGroups ? global::System.String.Empty : "expandGroups=" + global::System.Uri.EscapeDataString(expandGroups.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists a collection of products in the specified workspace in a service instance. + /// + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| state | filter | eq | |
| groups | expand | | |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains an array of groups that have visibility to the product. + /// The default is false. + /// Products which are part of a specific tag. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, bool? expandGroups, string tags, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == expandGroups ? global::System.String.Empty : "expandGroups=" + global::System.Uri.EscapeDataString(expandGroups.ToString())) + + "&" + + (string.IsNullOrEmpty(tags) ? global::System.String.Empty : "tags=" + global::System.Uri.EscapeDataString(tags)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| state | filter | eq | |
| groups | expand | | |
+ /// Number of records to return. + /// Number of records to skip. + /// When set to true, the response contains an array of groups that have visibility to the product. + /// The default is false. + /// Products which are part of a specific tag. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, bool? expandGroups, string tags, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(tags),tags); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates or updates policy configuration for the Product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductPolicyCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates policy configuration for the Product. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The policy contents to apply. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductPolicyCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductPolicyCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductPolicyCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// The policy contents to apply. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductPolicyCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the policy configuration at the Product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductPolicyDelete(string resourceGroupName, string serviceName, string workspaceId, string productId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the policy configuration at the Product. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductPolicyDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductPolicyDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductPolicyDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductPolicyDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the Product level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductPolicyGet(string resourceGroupName, string serviceName, string workspaceId, string productId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the ETag of the policy configuration at the Product level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductPolicyGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var policyId = @"policy"; + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/policies/" + + global::System.Uri.EscapeDataString(policyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the ETag of the policy configuration at the Product level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductPolicyGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/policies/" + + policyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductPolicyGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductPolicyGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductPolicyGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the Product level. + /// + /// Policy Export Format. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductPolicyGetViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/policies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/policies/{policyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var policyId = _match.Groups["policyId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/policies/" + + policyId + + "?" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductPolicyGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductPolicyGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// Policy Export Format. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductPolicyGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat? format, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"xml", @"rawxml"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Get the policy configuration at the Product level. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductPolicyListByProduct(string resourceGroupName, string serviceName, string workspaceId, string productId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductPolicyListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the policy configuration at the Product level. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductPolicyListByProductViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)/policies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}/policies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "/policies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductPolicyListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductPolicyListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductPolicyListByProduct_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Update existing product details. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductUpdate(string resourceGroupName, string serviceName, string workspaceId, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/products/" + + global::System.Uri.EscapeDataString(productId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Update existing product details. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceProductUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/products/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/products/{productId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var productId = _match.Groups["productId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/products/" + + productId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceProductUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Product identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceProductUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string productId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productId),productId); + await eventListener.AssertMinimumLength(nameof(productId),productId,1); + await eventListener.AssertMaximumLength(nameof(productId),productId,256); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates the subscription of specified user to the specified product. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string sid, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates the subscription of specified user to the specified product. + /// + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionCreateOrUpdateViaIdentity(global::System.String viaIdentity, bool? notify, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/subscriptions/" + + sid + + "?" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string sid, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(appType),appType); + await eventListener.AssertEnum(nameof(appType),appType,@"portal", @"developerPortal"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionDelete(string resourceGroupName, string serviceName, string workspaceId, string sid, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified subscription. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/subscriptions/" + + sid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string sid, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the specified Subscription entity. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionGet(string resourceGroupName, string serviceName, string workspaceId, string sid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionGetEntityTag(string resourceGroupName, string serviceName, string workspaceId, string sid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionGetEntityTagViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/subscriptions/" + + sid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionGetEntityTag_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionGetEntityTag_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionGetEntityTag_Validate(string resourceGroupName, string serviceName, string workspaceId, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the specified Subscription entity. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/subscriptions/" + + sid + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all subscriptions of the workspace in an API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionList(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/subscriptions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified Subscription keys. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionListSecrets(string resourceGroupName, string serviceName, string workspaceId, string sid, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified Subscription keys. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionListSecretsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/subscriptions/(?[^/]+)/listSecrets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/subscriptions/{sid}/listSecrets'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/subscriptions/" + + sid + + "/listSecrets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionListSecrets_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionListSecrets_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionKeysContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionListSecrets_Validate(string resourceGroupName, string serviceName, string workspaceId, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists all subscriptions of the workspace in an API Management service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionListViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/subscriptions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/subscriptions'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/subscriptions" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt + /// | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, + /// startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + /// userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | + /// | |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionList_Validate(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Regenerates primary key of existing subscription of the workspace in an API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionRegeneratePrimaryKey(string resourceGroupName, string serviceName, string workspaceId, string sid, string subscriptionId, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "/regeneratePrimaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionRegeneratePrimaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Regenerates primary key of existing subscription of the workspace in an API Management service instance. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionRegeneratePrimaryKeyViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/subscriptions/(?[^/]+)/regeneratePrimaryKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/subscriptions/{sid}/regeneratePrimaryKey'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/subscriptions/" + + sid + + "/regeneratePrimaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionRegeneratePrimaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionRegeneratePrimaryKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionRegeneratePrimaryKey_Validate(string resourceGroupName, string serviceName, string workspaceId, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Regenerates secondary key of existing subscription of the workspace in an API Management service instance. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionRegenerateSecondaryKey(string resourceGroupName, string serviceName, string workspaceId, string sid, string subscriptionId, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "/regenerateSecondaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionRegenerateSecondaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Regenerates secondary key of existing subscription of the workspace in an API Management service instance. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionRegenerateSecondaryKeyViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/subscriptions/(?[^/]+)/regenerateSecondaryKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/subscriptions/{sid}/regenerateSecondaryKey'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/subscriptions/" + + sid + + "/regenerateSecondaryKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionRegenerateSecondaryKey_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionRegenerateSecondaryKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionRegenerateSecondaryKey_Validate(string resourceGroupName, string serviceName, string workspaceId, string sid, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of a subscription specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionUpdate(string resourceGroupName, string serviceName, string workspaceId, string sid, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/subscriptions/" + + global::System.Uri.EscapeDataString(sid) + + "?" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of a subscription specified by its identifier. + /// + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceSubscriptionUpdateViaIdentity(global::System.String viaIdentity, bool? notify, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/subscriptions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/subscriptions/{sid}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var sid = _match.Groups["sid"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/subscriptions/" + + sid + + "?" + + (null == notify ? global::System.String.Empty : "notify=" + global::System.Uri.EscapeDataString(notify.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(appType) ? global::System.String.Empty : "appType=" + global::System.Uri.EscapeDataString(appType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceSubscriptionUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Subscription entity Identifier. The entity represents the association between a user and a product in + /// API Management. + /// Notify change in Subscription State. + /// - If false, do not send any email notification for change of state of subscription + /// - If true, send email notification of change of state of subscription + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Determines the type of application which send the create user request. Default is legacy publisher + /// portal. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceSubscriptionUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string sid, bool? notify, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? appType, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(sid),sid); + await eventListener.AssertMaximumLength(nameof(sid),sid,256); + await eventListener.AssertRegEx(nameof(sid),sid,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(appType),appType); + await eventListener.AssertEnum(nameof(appType),appType,@"portal", @"developerPortal"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Adds an API to the specified tag via link. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagApiLinkCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagApiLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds an API to the specified tag via link. + /// + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagApiLinkCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagApiLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagApiLinkCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagApiLinkCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified API from the specified tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagApiLinkDelete(string resourceGroupName, string serviceName, string workspaceId, string tagId, string apiLinkId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagApiLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified API from the specified tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagApiLinkDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagApiLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagApiLinkDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagApiLinkDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the API link for the tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagApiLinkGet(string resourceGroupName, string serviceName, string workspaceId, string tagId, string apiLinkId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/apiLinks/" + + global::System.Uri.EscapeDataString(apiLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagApiLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the API link for the tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagApiLinkGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/apiLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/apiLinks/{apiLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var apiLinkId = _match.Groups["apiLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/apiLinks/" + + apiLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagApiLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagApiLinkGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-API link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagApiLinkGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string apiLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(apiLinkId),apiLinkId); + await eventListener.AssertMinimumLength(nameof(apiLinkId),apiLinkId,1); + await eventListener.AssertMaximumLength(nameof(apiLinkId),apiLinkId,80); + await eventListener.AssertRegEx(nameof(apiLinkId),apiLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the API links associated with a tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagApiLinkListByProduct(string resourceGroupName, string serviceName, string workspaceId, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/apiLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagApiLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the API links associated with a tag. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagApiLinkListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/apiLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/apiLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/apiLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagApiLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagApiLinkListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagApiLinkListByProduct_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Creates a tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates a tag. + /// + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// Create parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. Not required when creating an entity, but required when updating an entity. + /// The ID of the target subscription. The value must be an UUID. + /// Create parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specific tag of the workspace in an API Management service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagDelete(string resourceGroupName, string serviceName, string workspaceId, string tagId, string ifMatch, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific tag of the workspace in an API Management service instance. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the tag specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagGet(string resourceGroupName, string serviceName, string workspaceId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagGetEntityState(string resourceGroupName, string serviceName, string workspaceId, string tagId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagGetEntityState_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the entity state version of the tag specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagGetEntityStateViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Head, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagGetEntityState_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagGetEntityState_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.514/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagGetEntityState_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the details of the tag specified by its identifier. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of tags defined within a workspace in a service instance. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Scope like 'apis', 'products' or 'apis/{apiId} + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagListByService(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string scope, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(scope) ? global::System.String.Empty : "scope=" + global::System.Uri.EscapeDataString(scope)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of tags defined within a workspace in a service instance. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Scope like 'apis', 'products' or 'apis/{apiId} + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagListByServiceViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (string.IsNullOrEmpty(scope) ? global::System.String.Empty : "scope=" + global::System.Uri.EscapeDataString(scope)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagListByService_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagListByService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, + /// le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// Scope like 'apis', 'products' or 'apis/{apiId} + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagListByService_Validate(string resourceGroupName, string serviceName, string workspaceId, string Filter, int? Top, int? Skip, string scope, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds an operation to the specified tag via link. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string operationLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/operationLinks/" + + global::System.Uri.EscapeDataString(operationLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagOperationLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds an operation to the specified tag via link. + /// + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/operationLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/operationLinks/{operationLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var operationLinkId = _match.Groups["operationLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/operationLinks/" + + operationLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagOperationLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string operationLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationLinkId),operationLinkId); + await eventListener.AssertMinimumLength(nameof(operationLinkId),operationLinkId,1); + await eventListener.AssertMaximumLength(nameof(operationLinkId),operationLinkId,80); + await eventListener.AssertRegEx(nameof(operationLinkId),operationLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified operation from the specified tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkDelete(string resourceGroupName, string serviceName, string workspaceId, string tagId, string operationLinkId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/operationLinks/" + + global::System.Uri.EscapeDataString(operationLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagOperationLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified operation from the specified tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/operationLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/operationLinks/{operationLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var operationLinkId = _match.Groups["operationLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/operationLinks/" + + operationLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagOperationLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string operationLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationLinkId),operationLinkId); + await eventListener.AssertMinimumLength(nameof(operationLinkId),operationLinkId,1); + await eventListener.AssertMaximumLength(nameof(operationLinkId),operationLinkId,80); + await eventListener.AssertRegEx(nameof(operationLinkId),operationLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the operation link for the tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkGet(string resourceGroupName, string serviceName, string workspaceId, string tagId, string operationLinkId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/operationLinks/" + + global::System.Uri.EscapeDataString(operationLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagOperationLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the operation link for the tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/operationLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/operationLinks/{operationLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var operationLinkId = _match.Groups["operationLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/operationLinks/" + + operationLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagOperationLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string operationLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(operationLinkId),operationLinkId); + await eventListener.AssertMinimumLength(nameof(operationLinkId),operationLinkId,1); + await eventListener.AssertMaximumLength(nameof(operationLinkId),operationLinkId,80); + await eventListener.AssertRegEx(nameof(operationLinkId),operationLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the operation links associated with a tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// operationId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkListByProduct(string resourceGroupName, string serviceName, string workspaceId, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/operationLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagOperationLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the operation links associated with a tag. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// operationId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/operationLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/operationLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/operationLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagOperationLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// operationId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagOperationLinkListByProduct_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Adds a product to the specified tag via link. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagProductLinkCreateOrUpdate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string productLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/productLinks/" + + global::System.Uri.EscapeDataString(productLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagProductLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Adds a product to the specified tag via link. + /// + /// Create or update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagProductLinkCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/productLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/productLinks/{productLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var productLinkId = _match.Groups["productLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/productLinks/" + + productLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagProductLinkCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagProductLinkCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// Create or update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagProductLinkCreateOrUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string productLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productLinkId),productLinkId); + await eventListener.AssertMinimumLength(nameof(productLinkId),productLinkId,1); + await eventListener.AssertMaximumLength(nameof(productLinkId),productLinkId,80); + await eventListener.AssertRegEx(nameof(productLinkId),productLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified product from the specified tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagProductLinkDelete(string resourceGroupName, string serviceName, string workspaceId, string tagId, string productLinkId, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/productLinks/" + + global::System.Uri.EscapeDataString(productLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagProductLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified product from the specified tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagProductLinkDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/productLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/productLinks/{productLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var productLinkId = _match.Groups["productLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/productLinks/" + + productLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagProductLinkDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagProductLinkDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagProductLinkDelete_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string productLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productLinkId),productLinkId); + await eventListener.AssertMinimumLength(nameof(productLinkId),productLinkId,1); + await eventListener.AssertMaximumLength(nameof(productLinkId),productLinkId,80); + await eventListener.AssertRegEx(nameof(productLinkId),productLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Gets the product link for the tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagProductLinkGet(string resourceGroupName, string serviceName, string workspaceId, string tagId, string productLinkId, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/productLinks/" + + global::System.Uri.EscapeDataString(productLinkId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagProductLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the product link for the tag. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagProductLinkGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/productLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/productLinks/{productLinkId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var productLinkId = _match.Groups["productLinkId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/productLinks/" + + productLinkId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagProductLinkGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagProductLinkGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagProductLinkGet_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string productLinkId, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(productLinkId),productLinkId); + await eventListener.AssertMinimumLength(nameof(productLinkId),productLinkId,1); + await eventListener.AssertMaximumLength(nameof(productLinkId),productLinkId,80); + await eventListener.AssertRegEx(nameof(productLinkId),productLinkId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Lists a collection of the product links associated with a tag. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagProductLinkListByProduct(string resourceGroupName, string serviceName, string workspaceId, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "/productLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagProductLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists a collection of the product links associated with a tag. + /// + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagProductLinkListByProductViaIdentity(global::System.String viaIdentity, string Filter, int? Top, int? Skip, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)/productLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}/productLinks'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "/productLinks" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagProductLinkListByProduct_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagProductLinkListByProduct_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| + /// productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ /// Number of records to return. + /// Number of records to skip. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagProductLinkListByProduct_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string Filter, int? Top, int? Skip, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertIsGreaterThanOrEqual(nameof(Top),Top,1); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Updates the details of the tag specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagUpdate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "/tags/" + + global::System.Uri.EscapeDataString(tagId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the tag specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceTagUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)/tags/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/tags/{tagId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var tagId = _match.Groups["tagId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "/tags/" + + tagId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceTagUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// Tag identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceTagUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string tagId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(tagId),tagId); + await eventListener.AssertMinimumLength(nameof(tagId),tagId,1); + await eventListener.AssertMaximumLength(nameof(tagId),tagId,80); + await eventListener.AssertRegEx(nameof(tagId),tagId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Updates the details of the workspace specified by its identifier. + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Workspace Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceUpdate(string resourceGroupName, string serviceName, string workspaceId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ApiManagement/service/" + + global::System.Uri.EscapeDataString(serviceName) + + "/workspaces/" + + global::System.Uri.EscapeDataString(workspaceId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the details of the workspace specified by its identifier. + /// + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// Workspace Update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkspaceUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ApiManagement/service/(?[^/]+)/workspaces/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var serviceName = _match.Groups["serviceName"].Value; + var workspaceId = _match.Groups["workspaceId"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ApiManagement/service/" + + serviceName + + "/workspaces/" + + workspaceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkspaceUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WorkspaceContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group. The name is case insensitive. + /// The name of the API Management service. + /// Workspace identifier. Must be unique in the current API Management service instance. + /// ETag of the Entity. ETag should match the current entity state from the header response of the GET + /// request or it should be * for unconditional update. + /// The ID of the target subscription. The value must be an UUID. + /// Workspace Update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WorkspaceUpdate_Validate(string resourceGroupName, string serviceName, string workspaceId, string ifMatch, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract body, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(serviceName),serviceName); + await eventListener.AssertMinimumLength(nameof(serviceName),serviceName,1); + await eventListener.AssertMaximumLength(nameof(serviceName),serviceName,50); + await eventListener.AssertRegEx(nameof(serviceName),serviceName,@"^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + await eventListener.AssertNotNull(nameof(workspaceId),workspaceId); + await eventListener.AssertMinimumLength(nameof(workspaceId),workspaceId,1); + await eventListener.AssertMaximumLength(nameof(workspaceId),workspaceId,80); + await eventListener.AssertRegEx(nameof(workspaceId),workspaceId,@"^[^*#&+:<>?]+$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Any.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Any.cs new file mode 100644 index 000000000000..afcb245debeb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Any.cs @@ -0,0 +1,34 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Any object + public partial class Any : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAnyInternal + { + + /// Creates an new instance. + public Any() + { + + } + } + /// Any object + public partial interface IAny : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + + } + /// Any object + internal partial interface IAnyInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Any.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Any.json.cs new file mode 100644 index 000000000000..26eb6e3b06a3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Any.json.cs @@ -0,0 +1,104 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Any object + public partial class Any + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal Any(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new Any(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpoint.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpoint.cs new file mode 100644 index 000000000000..ba3c36b5a47a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpoint.cs @@ -0,0 +1,54 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The Private Endpoint resource. + public partial class PrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointInternal + { + + /// Backing field for property. + private string _id; + + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointInternal.Id { get => this._id; set { {_id = value;} } } + + /// Creates an new instance. + public PrivateEndpoint() + { + + } + } + /// The Private Endpoint resource. + public partial interface IPrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ARM identifier for Private Endpoint", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + + } + /// The Private Endpoint resource. + internal partial interface IPrivateEndpointInternal + + { + /// The ARM identifier for Private Endpoint + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpoint.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpoint.json.cs new file mode 100644 index 000000000000..cfe4bd331ec8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpoint.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The Private Endpoint resource. + public partial class PrivateEndpoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateEndpoint(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpoint(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..062ed2937ec6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnection.cs @@ -0,0 +1,189 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The Private Endpoint Connection resource. + public partial class PrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value; } + + /// Internal Acessors for PrivateEndpointId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateEndpointConnectionProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } + + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionProperties _property; + + /// Resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateEndpointConnectionProperties()); set => this._property = value; } + + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public PrivateEndpointConnection() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The Private Endpoint Connection resource. + public partial interface IPrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ARM identifier for Private Endpoint", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state of the private endpoint connection resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + + } + /// The Private Endpoint Connection resource. + internal partial interface IPrivateEndpointConnectionInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// The resource of private end point. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint PrivateEndpoint { get; set; } + /// The ARM identifier for Private Endpoint + string PrivateEndpointId { get; set; } + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// Resource properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionProperties Property { get; set; } + /// The provisioning state of the private endpoint connection resource. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnection.json.cs new file mode 100644 index 000000000000..dd938a41b2b4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnection.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The Private Endpoint Connection resource. + public partial class PrivateEndpointConnection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateEndpointConnection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionListResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..631c43306e23 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionListResult.cs @@ -0,0 +1,53 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// List of private endpoint connection associated with the specified storage account + /// + public partial class PrivateEndpointConnectionListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionListResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnection[] _value; + + /// Array of private endpoint connections + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnection[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PrivateEndpointConnectionListResult() + { + + } + } + /// List of private endpoint connection associated with the specified storage account + public partial interface IPrivateEndpointConnectionListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Array of private endpoint connections + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of private endpoint connections", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnection[] Value { get; set; } + + } + /// List of private endpoint connection associated with the specified storage account + internal partial interface IPrivateEndpointConnectionListResultInternal + + { + /// Array of private endpoint connections + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnection[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionListResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionListResult.json.cs new file mode 100644 index 000000000000..b0ae0ca195f7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionListResult.json.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// List of private endpoint connection associated with the specified storage account + /// + public partial class PrivateEndpointConnectionListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionListResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateEndpointConnection.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..fa1b0eb685c7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionProperties.cs @@ -0,0 +1,153 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the PrivateEndpointConnectProperties. + public partial class PrivateEndpointConnectionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal + { + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateEndpoint()); set { {_privateEndpoint = value;} } } + + /// Internal Acessors for PrivateEndpointId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointInternal)PrivateEndpoint).Id = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint _privateEndpoint; + + /// The resource of private end point. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateEndpoint()); set => this._privateEndpoint = value; } + + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointInternal)PrivateEndpoint).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; + + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired = value ?? null; } + + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState? _provisioningState; + + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Creates an new instance. + public PrivateEndpointConnectionProperties() + { + + } + } + /// Properties of the PrivateEndpointConnectProperties. + public partial interface IPrivateEndpointConnectionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ARM identifier for Private Endpoint", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state of the private endpoint connection resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + + } + /// Properties of the PrivateEndpointConnectProperties. + internal partial interface IPrivateEndpointConnectionPropertiesInternal + + { + /// The resource of private end point. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint PrivateEndpoint { get; set; } + /// The ARM identifier for Private Endpoint + string PrivateEndpointId { get; set; } + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The provisioning state of the private endpoint connection resource. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionProperties.json.cs new file mode 100644 index 000000000000..fb884ae4568e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateEndpointConnectionProperties.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the PrivateEndpointConnectProperties. + public partial class PrivateEndpointConnectionProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpointConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : PrivateEndpoint;} + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : PrivateLinkServiceConnectionState;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null,serializationMode) : null, "privateEndpoint" ,container.Add ); + AddIf( null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null,serializationMode) : null, "privateLinkServiceConnectionState" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResource.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResource.cs new file mode 100644 index 000000000000..2e49ebc13de9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResource.cs @@ -0,0 +1,137 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A private link resource + public partial class PrivateLinkResource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResource, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// The private link resource group id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal)Property).GroupId; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for GroupId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal)Property).GroupId = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkResourceProperties()); set { {_property = value;} } } + + /// Internal Acessors for RequiredMember + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceInternal.RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceProperties _property; + + /// Resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkResourceProperties()); set => this._property = value; } + + /// The private link resource required member names. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; } + + /// The private link resource Private link DNS zone name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] RequiredZoneName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName = value ?? null /* arrayOf */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public PrivateLinkResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// A private link resource + public partial interface IPrivateLinkResource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// The private link resource group id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The private link resource group id.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + string GroupId { get; } + /// The private link resource required member names. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The private link resource required member names.", + SerializedName = @"requiredMembers", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredMember { get; } + /// The private link resource Private link DNS zone name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link resource Private link DNS zone name.", + SerializedName = @"requiredZoneNames", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredZoneName { get; set; } + + } + /// A private link resource + internal partial interface IPrivateLinkResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// The private link resource group id. + string GroupId { get; set; } + /// Resource properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceProperties Property { get; set; } + /// The private link resource required member names. + string[] RequiredMember { get; set; } + /// The private link resource Private link DNS zone name. + string[] RequiredZoneName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResource.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResource.json.cs new file mode 100644 index 000000000000..cd4ce57cfc53 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResource.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A private link resource + public partial class PrivateLinkResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateLinkResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResource(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkResourceProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceListResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..ed3a92bd9c8f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceListResult.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A list of private link resources + public partial class PrivateLinkResourceListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResource[] _value; + + /// Array of private link resources + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PrivateLinkResourceListResult() + { + + } + } + /// A list of private link resources + public partial interface IPrivateLinkResourceListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Array of private link resources + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of private link resources", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResource) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResource[] Value { get; set; } + + } + /// A list of private link resources + internal partial interface IPrivateLinkResourceListResultInternal + + { + /// Array of private link resources + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceListResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceListResult.json.cs new file mode 100644 index 000000000000..2e2a26c1dec5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceListResult.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A list of private link resources + public partial class PrivateLinkResourceListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateLinkResourceListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResourceListResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResource) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..5084cd0e46a8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceProperties.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of a private link resource. + public partial class PrivateLinkResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal + { + + /// Backing field for property. + private string _groupId; + + /// The private link resource group id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string GroupId { get => this._groupId; } + + /// Internal Acessors for GroupId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } + + /// Internal Acessors for RequiredMember + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourcePropertiesInternal.RequiredMember { get => this._requiredMember; set { {_requiredMember = value;} } } + + /// Backing field for property. + private string[] _requiredMember; + + /// The private link resource required member names. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] RequiredMember { get => this._requiredMember; } + + /// Backing field for property. + private string[] _requiredZoneName; + + /// The private link resource Private link DNS zone name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] RequiredZoneName { get => this._requiredZoneName; set => this._requiredZoneName = value; } + + /// Creates an new instance. + public PrivateLinkResourceProperties() + { + + } + } + /// Properties of a private link resource. + public partial interface IPrivateLinkResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The private link resource group id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The private link resource group id.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + string GroupId { get; } + /// The private link resource required member names. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The private link resource required member names.", + SerializedName = @"requiredMembers", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredMember { get; } + /// The private link resource Private link DNS zone name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link resource Private link DNS zone name.", + SerializedName = @"requiredZoneNames", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredZoneName { get; set; } + + } + /// Properties of a private link resource. + internal partial interface IPrivateLinkResourcePropertiesInternal + + { + /// The private link resource group id. + string GroupId { get; set; } + /// The private link resource required member names. + string[] RequiredMember { get; set; } + /// The private link resource Private link DNS zone name. + string[] RequiredZoneName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceProperties.json.cs new file mode 100644 index 000000000000..5f9b47d69ed6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkResourceProperties.json.cs @@ -0,0 +1,134 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of a private link resource. + public partial class PrivateLinkResourceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateLinkResourceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResourceProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)GroupId;} + {_requiredMember = If( json?.PropertyT("requiredMembers"), out var __jsonRequiredMembers) ? If( __jsonRequiredMembers as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : RequiredMember;} + {_requiredZoneName = If( json?.PropertyT("requiredZoneNames"), out var __jsonRequiredZoneNames) ? If( __jsonRequiredZoneNames as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : RequiredZoneName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._requiredMember) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._requiredMember ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("requiredMembers",__w); + } + } + if (null != this._requiredZoneName) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._requiredZoneName ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("requiredZoneNames",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkServiceConnectionState.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..4e05edb9dfd0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,99 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + public partial class PrivateLinkServiceConnectionState : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal + { + + /// Backing field for property. + private string _actionsRequired; + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ActionsRequired { get => this._actionsRequired; set => this._actionsRequired = value; } + + /// Backing field for property. + private string _description; + + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? _status; + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public PrivateLinkServiceConnectionState() + { + + } + } + /// A collection of information about the state of the connection between service consumer and provider. + public partial interface IPrivateLinkServiceConnectionState : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + string ActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? Status { get; set; } + + } + /// A collection of information about the state of the connection between service consumer and provider. + internal partial interface IPrivateLinkServiceConnectionStateInternal + + { + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + string ActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + string Description { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkServiceConnectionState.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkServiceConnectionState.json.cs new file mode 100644 index 000000000000..a19c4bdeb9d6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/PrivateLinkServiceConnectionState.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + public partial class PrivateLinkServiceConnectionState + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateLinkServiceConnectionState(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkServiceConnectionState(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_actionsRequired = If( json?.PropertyT("actionsRequired"), out var __jsonActionsRequired) ? (string)__jsonActionsRequired : (string)ActionsRequired;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._actionsRequired)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._actionsRequired.ToString()) : null, "actionsRequired" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/ProxyResource.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/ProxyResource.cs new file mode 100644 index 000000000000..9ccdb9a35f4c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/ProxyResource.cs @@ -0,0 +1,79 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + public partial class ProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IProxyResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ProxyResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + public partial interface IProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + internal partial interface IProxyResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/ProxyResource.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/ProxyResource.json.cs new file mode 100644 index 000000000000..300fa6b576f7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/ProxyResource.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + public partial class ProxyResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IProxyResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IProxyResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/Resource.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/Resource.cs new file mode 100644 index 000000000000..66801a2946b5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/Resource.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + + /// Backing field for property. + private string _id; + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Resource() + { + + } + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + public partial interface IResource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the resource", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + internal partial interface IResourceInternal + + { + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + string Id { get; set; } + /// The name of the resource + string Name { get; set; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/Resource.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/Resource.json.cs new file mode 100644 index 000000000000..1a4e7e0ecbb9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20/Resource.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCollection.cs new file mode 100644 index 000000000000..cd372e78ad76 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged AccessInformation list representation. + public partial class AccessInformationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract[] Value { get => this._value; } + + /// Creates an new instance. + public AccessInformationCollection() + { + + } + } + /// Paged AccessInformation list representation. + public partial interface IAccessInformationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract[] Value { get; } + + } + /// Paged AccessInformation list representation. + internal partial interface IAccessInformationCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCollection.json.cs new file mode 100644 index 000000000000..14ca4efec3a7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged AccessInformation list representation. + public partial class AccessInformationCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AccessInformationCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AccessInformationCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContract.cs new file mode 100644 index 000000000000..ee5c3691ddd5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContract.cs @@ -0,0 +1,155 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant Settings. + public partial class AccessInformationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractPropertiesInternal)Property).Enabled = value ?? default(bool); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Principal (User) Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractPropertiesInternal)Property).PrincipalId = value ?? null; } + + /// Access Information type ('access' or 'gitAccess') + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PropertiesId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractPropertiesInternal)Property).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractProperties _property; + + /// AccessInformation entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public AccessInformationContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Tenant Settings. + public partial interface IAccessInformationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether direct access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// Principal (User) Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Principal (User) Identifier.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; set; } + /// Access Information type ('access' or 'gitAccess') + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access Information type ('access' or 'gitAccess')", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PropertiesId { get; set; } + + } + /// Tenant Settings. + internal partial interface IAccessInformationContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Determines whether direct access is enabled. + bool? Enabled { get; set; } + /// Principal (User) Identifier. + string PrincipalId { get; set; } + /// Access Information type ('access' or 'gitAccess') + string PropertiesId { get; set; } + /// AccessInformation entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContract.json.cs new file mode 100644 index 000000000000..ff7a1573b1e8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant Settings. + public partial class AccessInformationContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AccessInformationContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AccessInformationContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContractProperties.cs new file mode 100644 index 000000000000..a9554f1ff2d3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContractProperties.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information contract of the API Management service. + public partial class AccessInformationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractPropertiesInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private string _id; + + /// Access Information type ('access' or 'gitAccess') + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _principalId; + + /// Principal (User) Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; set => this._principalId = value; } + + /// Creates an new instance. + public AccessInformationContractProperties() + { + + } + } + /// Tenant access information contract of the API Management service. + public partial interface IAccessInformationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether direct access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// Access Information type ('access' or 'gitAccess') + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access Information type ('access' or 'gitAccess')", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Principal (User) Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Principal (User) Identifier.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; set; } + + } + /// Tenant access information contract of the API Management service. + internal partial interface IAccessInformationContractPropertiesInternal + + { + /// Determines whether direct access is enabled. + bool? Enabled { get; set; } + /// Access Information type ('access' or 'gitAccess') + string Id { get; set; } + /// Principal (User) Identifier. + string PrincipalId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContractProperties.json.cs new file mode 100644 index 000000000000..f5f88039ad5f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationContractProperties.json.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information contract of the API Management service. + public partial class AccessInformationContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AccessInformationContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AccessInformationContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameterProperties.cs new file mode 100644 index 000000000000..b4c5ec9c4fb0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameterProperties.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information update parameters of the API Management service + public partial class AccessInformationCreateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterPropertiesInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private string _primaryKey; + + /// + /// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrimaryKey { get => this._primaryKey; set => this._primaryKey = value; } + + /// Backing field for property. + private string _principalId; + + /// Principal (User) Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; set => this._principalId = value; } + + /// Backing field for property. + private string _secondaryKey; + + /// + /// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SecondaryKey { get => this._secondaryKey; set => this._secondaryKey = value; } + + /// + /// Creates an new instance. + /// + public AccessInformationCreateParameterProperties() + { + + } + } + /// Tenant access information update parameters of the API Management service + public partial interface IAccessInformationCreateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether direct access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"primaryKey", + PossibleTypes = new [] { typeof(string) })] + string PrimaryKey { get; set; } + /// Principal (User) Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Principal (User) Identifier.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; set; } + /// + /// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"secondaryKey", + PossibleTypes = new [] { typeof(string) })] + string SecondaryKey { get; set; } + + } + /// Tenant access information update parameters of the API Management service + internal partial interface IAccessInformationCreateParameterPropertiesInternal + + { + /// Determines whether direct access is enabled. + bool? Enabled { get; set; } + /// + /// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string PrimaryKey { get; set; } + /// Principal (User) Identifier. + string PrincipalId { get; set; } + /// + /// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + /// + string SecondaryKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameterProperties.json.cs new file mode 100644 index 000000000000..95ce2731c530 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameterProperties.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information update parameters of the API Management service + public partial class AccessInformationCreateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AccessInformationCreateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} + {_primaryKey = If( json?.PropertyT("primaryKey"), out var __jsonPrimaryKey) ? (string)__jsonPrimaryKey : (string)PrimaryKey;} + {_secondaryKey = If( json?.PropertyT("secondaryKey"), out var __jsonSecondaryKey) ? (string)__jsonSecondaryKey : (string)SecondaryKey;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AccessInformationCreateParameterProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + AddIf( null != (((object)this._primaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._primaryKey.ToString()) : null, "primaryKey" ,container.Add ); + AddIf( null != (((object)this._secondaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._secondaryKey.ToString()) : null, "secondaryKey" ,container.Add ); + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameters.cs new file mode 100644 index 000000000000..671556e53043 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameters.cs @@ -0,0 +1,117 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information update parameters. + public partial class AccessInformationCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParametersInternal + { + + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterPropertiesInternal)Property).Enabled = value ?? default(bool); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationCreateParameterProperties()); set { {_property = value;} } } + + /// + /// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrimaryKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterPropertiesInternal)Property).PrimaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterPropertiesInternal)Property).PrimaryKey = value ?? null; } + + /// Principal (User) Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterPropertiesInternal)Property).PrincipalId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterProperties _property; + + /// Tenant access information update parameter properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationCreateParameterProperties()); set => this._property = value; } + + /// + /// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SecondaryKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterPropertiesInternal)Property).SecondaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterPropertiesInternal)Property).SecondaryKey = value ?? null; } + + /// Creates an new instance. + public AccessInformationCreateParameters() + { + + } + } + /// Tenant access information update parameters. + public partial interface IAccessInformationCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether direct access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"primaryKey", + PossibleTypes = new [] { typeof(string) })] + string PrimaryKey { get; set; } + /// Principal (User) Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Principal (User) Identifier.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; set; } + /// + /// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"secondaryKey", + PossibleTypes = new [] { typeof(string) })] + string SecondaryKey { get; set; } + + } + /// Tenant access information update parameters. + internal partial interface IAccessInformationCreateParametersInternal + + { + /// Determines whether direct access is enabled. + bool? Enabled { get; set; } + /// + /// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string PrimaryKey { get; set; } + /// Principal (User) Identifier. + string PrincipalId { get; set; } + /// Tenant access information update parameter properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameterProperties Property { get; set; } + /// + /// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + /// + string SecondaryKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameters.json.cs new file mode 100644 index 000000000000..8eff0c291a10 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationCreateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information update parameters. + public partial class AccessInformationCreateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AccessInformationCreateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationCreateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationCreateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AccessInformationCreateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationSecretsContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationSecretsContract.cs new file mode 100644 index 000000000000..4fd212d22349 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationSecretsContract.cs @@ -0,0 +1,158 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information contract of the API Management service. + public partial class AccessInformationSecretsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationSecretsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationSecretsContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Backing field for property. + private bool? _enabled; + + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private string _id; + + /// Access Information type ('access' or 'gitAccess') + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _primaryKey; + + /// + /// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrimaryKey { get => this._primaryKey; set => this._primaryKey = value; } + + /// Backing field for property. + private string _principalId; + + /// Principal (User) Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; set => this._principalId = value; } + + /// Backing field for property. + private string _secondaryKey; + + /// + /// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SecondaryKey { get => this._secondaryKey; set => this._secondaryKey = value; } + + /// Creates an new instance. + public AccessInformationSecretsContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationSecretsContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + /// Tenant access information contract of the API Management service. + public partial interface IAccessInformationSecretsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether direct access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// Access Information type ('access' or 'gitAccess') + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access Information type ('access' or 'gitAccess')", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// + /// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"primaryKey", + PossibleTypes = new [] { typeof(string) })] + string PrimaryKey { get; set; } + /// Principal (User) Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Principal (User) Identifier.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; set; } + /// + /// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"secondaryKey", + PossibleTypes = new [] { typeof(string) })] + string SecondaryKey { get; set; } + + } + /// Tenant access information contract of the API Management service. + internal partial interface IAccessInformationSecretsContractInternal + + { + string ETag { get; set; } + /// Determines whether direct access is enabled. + bool? Enabled { get; set; } + /// Access Information type ('access' or 'gitAccess') + string Id { get; set; } + /// + /// Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string PrimaryKey { get; set; } + /// Principal (User) Identifier. + string PrincipalId { get; set; } + /// + /// Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + /// + string SecondaryKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationSecretsContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationSecretsContract.json.cs new file mode 100644 index 000000000000..074e70f227e5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationSecretsContract.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information contract of the API Management service. + public partial class AccessInformationSecretsContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AccessInformationSecretsContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} + {_primaryKey = If( json?.PropertyT("primaryKey"), out var __jsonPrimaryKey) ? (string)__jsonPrimaryKey : (string)PrimaryKey;} + {_secondaryKey = If( json?.PropertyT("secondaryKey"), out var __jsonSecondaryKey) ? (string)__jsonSecondaryKey : (string)SecondaryKey;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationSecretsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationSecretsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationSecretsContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AccessInformationSecretsContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + AddIf( null != (((object)this._primaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._primaryKey.ToString()) : null, "primaryKey" ,container.Add ); + AddIf( null != (((object)this._secondaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._secondaryKey.ToString()) : null, "secondaryKey" ,container.Add ); + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameterProperties.cs new file mode 100644 index 000000000000..84b69130bc65 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameterProperties.cs @@ -0,0 +1,53 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information update parameters of the API Management service + public partial class AccessInformationUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterPropertiesInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public AccessInformationUpdateParameterProperties() + { + + } + } + /// Tenant access information update parameters of the API Management service + public partial interface IAccessInformationUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether direct access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Tenant access information update parameters of the API Management service + internal partial interface IAccessInformationUpdateParameterPropertiesInternal + + { + /// Determines whether direct access is enabled. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..4127c87d5db9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameterProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information update parameters of the API Management service + public partial class AccessInformationUpdateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AccessInformationUpdateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AccessInformationUpdateParameterProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameters.cs new file mode 100644 index 000000000000..95f22921d9c5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameters.cs @@ -0,0 +1,60 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information update parameters. + public partial class AccessInformationUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParametersInternal + { + + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterPropertiesInternal)Property).Enabled = value ?? default(bool); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationUpdateParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterProperties _property; + + /// Tenant access information update parameter properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationUpdateParameterProperties()); set => this._property = value; } + + /// Creates an new instance. + public AccessInformationUpdateParameters() + { + + } + } + /// Tenant access information update parameters. + public partial interface IAccessInformationUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether direct access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether direct access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Tenant access information update parameters. + internal partial interface IAccessInformationUpdateParametersInternal + + { + /// Determines whether direct access is enabled. + bool? Enabled { get; set; } + /// Tenant access information update parameter properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameterProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameters.json.cs new file mode 100644 index 000000000000..f8700b0d9809 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AccessInformationUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information update parameters. + public partial class AccessInformationUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AccessInformationUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AccessInformationUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAccessInformationUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AccessInformationUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AdditionalLocation.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AdditionalLocation.cs new file mode 100644 index 000000000000..ae930ad16d69 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AdditionalLocation.cs @@ -0,0 +1,382 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Description of an additional API Management resource location. + public partial class AdditionalLocation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocationInternal + { + + /// Backing field for property. + private bool? _disableGateway; + + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in this additional location. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? DisableGateway { get => this._disableGateway; set => this._disableGateway = value; } + + /// Backing field for property. + private string _gatewayRegionalUrl; + + /// Gateway URL of the API Management service in the Region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string GatewayRegionalUrl { get => this._gatewayRegionalUrl; } + + /// Backing field for property. + private string _location; + + /// The location name of the additional region among Azure Data center regions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocationInternal.GatewayRegionalUrl { get => this._gatewayRegionalUrl; set { {_gatewayRegionalUrl = value;} } } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocationInternal.OutboundPublicIPAddress { get => this._outboundPublicIPAddress; set { {_outboundPublicIPAddress = value;} } } + + /// Internal Acessors for PlatformVersion + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocationInternal.PlatformVersion { get => this._platformVersion; set { {_platformVersion = value;} } } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocationInternal.PrivateIPAddress { get => this._privateIPAddress; set { {_privateIPAddress = value;} } } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocationInternal.PublicIPAddress { get => this._publicIPAddress; set { {_publicIPAddress = value;} } } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocationInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceSkuProperties()); set { {_sku = value;} } } + + /// Internal Acessors for VirtualNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocationInternal.VirtualNetworkConfiguration { get => (this._virtualNetworkConfiguration = this._virtualNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.VirtualNetworkConfiguration()); set { {_virtualNetworkConfiguration = value;} } } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocationInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Subnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Subnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocationInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Vnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Vnetid = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? _natGatewayState; + + /// Property can be used to enable NAT Gateway for this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get => this._natGatewayState; set => this._natGatewayState = value; } + + /// Backing field for property. + private string[] _outboundPublicIPAddress; + + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] OutboundPublicIPAddress { get => this._outboundPublicIPAddress; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? _platformVersion; + + /// Compute Platform Version running the service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get => this._platformVersion; } + + /// Backing field for property. + private string[] _privateIPAddress; + + /// + /// Private Static Load Balanced IP addresses of the API Management service which is deployed in an Internal Virtual Network + /// in a particular additional location. Available only for Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] PrivateIPAddress { get => this._privateIPAddress; } + + /// Backing field for property. + private string[] _publicIPAddress; + + /// + /// Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for + /// Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] PublicIPAddress { get => this._publicIPAddress; } + + /// Backing field for property. + private string _publicIPAddressId; + + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the location. Supported + /// only for Premium SKU being deployed in Virtual Network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PublicIPAddressId { get => this._publicIPAddressId; set => this._publicIPAddressId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties _sku; + + /// SKU properties of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceSkuProperties()); set => this._sku = value; } + + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int SkuCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Capacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Capacity = value ; } + + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Name = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration _virtualNetworkConfiguration; + + /// Virtual network configuration for the location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get => (this._virtualNetworkConfiguration = this._virtualNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.VirtualNetworkConfiguration()); set => this._virtualNetworkConfiguration = value; } + + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationSubnetResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).SubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).SubnetResourceId = value ?? null; } + + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Subnetname; } + + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Vnetid; } + + /// Backing field for property. + private string[] _zone; + + /// A list of availability zones denoting where the resource needs to come from. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Zone { get => this._zone; set => this._zone = value; } + + /// Creates an new instance. + public AdditionalLocation() + { + + } + } + /// Description of an additional API Management resource location. + public partial interface IAdditionalLocation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in this additional location. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in this additional location.", + SerializedName = @"disableGateway", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableGateway { get; set; } + /// Gateway URL of the API Management service in the Region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gateway URL of the API Management service in the Region.", + SerializedName = @"gatewayRegionalUrl", + PossibleTypes = new [] { typeof(string) })] + string GatewayRegionalUrl { get; } + /// The location name of the additional region among Azure Data center regions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The location name of the additional region among Azure Data center regions.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// Property can be used to enable NAT Gateway for this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property can be used to enable NAT Gateway for this API Management service.", + SerializedName = @"natGatewayState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get; set; } + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on stv2 platform.", + SerializedName = @"outboundPublicIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] OutboundPublicIPAddress { get; } + /// Compute Platform Version running the service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Compute Platform Version running the service.", + SerializedName = @"platformVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get; } + /// + /// Private Static Load Balanced IP addresses of the API Management service which is deployed in an Internal Virtual Network + /// in a particular additional location. Available only for Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Private Static Load Balanced IP addresses of the API Management service which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, Standard, Premium and Isolated SKU.", + SerializedName = @"privateIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] PrivateIPAddress { get; } + /// + /// Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for + /// Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard, Premium and Isolated SKU.", + SerializedName = @"publicIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] PublicIPAddress { get; } + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the location. Supported + /// only for Premium SKU being deployed in Virtual Network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the location. Supported only for Premium SKU being deployed in Virtual Network.", + SerializedName = @"publicIpAddressId", + PossibleTypes = new [] { typeof(string) })] + string PublicIPAddressId { get; set; } + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0.", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(int) })] + int SkuCapacity { get; set; } + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Sku.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType SkuName { get; set; } + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full resource ID of a subnet in a virtual network to deploy the API Management service in.", + SerializedName = @"subnetResourceId", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationSubnetResourceId { get; set; } + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the subnet.", + SerializedName = @"subnetname", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationSubnetname { get; } + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The virtual network ID. This is typically a GUID. Expect a null GUID by default.", + SerializedName = @"vnetid", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationVnetid { get; } + /// A list of availability zones denoting where the resource needs to come from. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of availability zones denoting where the resource needs to come from.", + SerializedName = @"zones", + PossibleTypes = new [] { typeof(string) })] + string[] Zone { get; set; } + + } + /// Description of an additional API Management resource location. + internal partial interface IAdditionalLocationInternal + + { + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in this additional location. + /// + bool? DisableGateway { get; set; } + /// Gateway URL of the API Management service in the Region. + string GatewayRegionalUrl { get; set; } + /// The location name of the additional region among Azure Data center regions. + string Location { get; set; } + /// Property can be used to enable NAT Gateway for this API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get; set; } + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + string[] OutboundPublicIPAddress { get; set; } + /// Compute Platform Version running the service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get; set; } + /// + /// Private Static Load Balanced IP addresses of the API Management service which is deployed in an Internal Virtual Network + /// in a particular additional location. Available only for Basic, Standard, Premium and Isolated SKU. + /// + string[] PrivateIPAddress { get; set; } + /// + /// Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for + /// Basic, Standard, Premium and Isolated SKU. + /// + string[] PublicIPAddress { get; set; } + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the location. Supported + /// only for Premium SKU being deployed in Virtual Network. + /// + string PublicIPAddressId { get; set; } + /// SKU properties of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties Sku { get; set; } + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + int SkuCapacity { get; set; } + /// Name of the Sku. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType SkuName { get; set; } + /// Virtual network configuration for the location. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get; set; } + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + string VirtualNetworkConfigurationSubnetResourceId { get; set; } + /// The name of the subnet. + string VirtualNetworkConfigurationSubnetname { get; set; } + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + string VirtualNetworkConfigurationVnetid { get; set; } + /// A list of availability zones denoting where the resource needs to come from. + string[] Zone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AdditionalLocation.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AdditionalLocation.json.cs new file mode 100644 index 000000000000..7db51c4ee074 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AdditionalLocation.json.cs @@ -0,0 +1,177 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Description of an additional API Management resource location. + public partial class AdditionalLocation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AdditionalLocation(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceSkuProperties.FromJson(__jsonSku) : Sku;} + {_virtualNetworkConfiguration = If( json?.PropertyT("virtualNetworkConfiguration"), out var __jsonVirtualNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.VirtualNetworkConfiguration.FromJson(__jsonVirtualNetworkConfiguration) : VirtualNetworkConfiguration;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Zone;} + {_publicIPAddress = If( json?.PropertyT("publicIPAddresses"), out var __jsonPublicIPAddresses) ? If( __jsonPublicIPAddresses as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : PublicIPAddress;} + {_privateIPAddress = If( json?.PropertyT("privateIPAddresses"), out var __jsonPrivateIPAddresses) ? If( __jsonPrivateIPAddresses as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : PrivateIPAddress;} + {_publicIPAddressId = If( json?.PropertyT("publicIpAddressId"), out var __jsonPublicIPAddressId) ? (string)__jsonPublicIPAddressId : (string)PublicIPAddressId;} + {_gatewayRegionalUrl = If( json?.PropertyT("gatewayRegionalUrl"), out var __jsonGatewayRegionalUrl) ? (string)__jsonGatewayRegionalUrl : (string)GatewayRegionalUrl;} + {_natGatewayState = If( json?.PropertyT("natGatewayState"), out var __jsonNatGatewayState) ? (string)__jsonNatGatewayState : (string)NatGatewayState;} + {_outboundPublicIPAddress = If( json?.PropertyT("outboundPublicIPAddresses"), out var __jsonOutboundPublicIPAddresses) ? If( __jsonOutboundPublicIPAddresses as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : OutboundPublicIPAddress;} + {_disableGateway = If( json?.PropertyT("disableGateway"), out var __jsonDisableGateway) ? (bool?)__jsonDisableGateway : DisableGateway;} + {_platformVersion = If( json?.PropertyT("platformVersion"), out var __jsonPlatformVersion) ? (string)__jsonPlatformVersion : (string)PlatformVersion;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AdditionalLocation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._virtualNetworkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._virtualNetworkConfiguration.ToJson(null,serializationMode) : null, "virtualNetworkConfiguration" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (null != this._zone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._zone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("zones",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._publicIPAddress) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._publicIPAddress ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("publicIPAddresses",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._privateIPAddress) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __n in this._privateIPAddress ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("privateIPAddresses",__m); + } + } + AddIf( null != (((object)this._publicIPAddressId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._publicIPAddressId.ToString()) : null, "publicIpAddressId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._gatewayRegionalUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._gatewayRegionalUrl.ToString()) : null, "gatewayRegionalUrl" ,container.Add ); + } + AddIf( null != (((object)this._natGatewayState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._natGatewayState.ToString()) : null, "natGatewayState" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._outboundPublicIPAddress) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __i in this._outboundPublicIPAddress ) + { + AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__i.ToString()) : null ,__h.Add); + } + container.Add("outboundPublicIPAddresses",__h); + } + } + AddIf( null != this._disableGateway ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._disableGateway) : null, "disableGateway" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._platformVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._platformVersion.ToString()) : null, "platformVersion" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesCollection.cs new file mode 100644 index 000000000000..7e4910516c5a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesCollection.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of All Policies. + public partial class AllPoliciesCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesCollectionInternal + { + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContract[] _value; + + /// AllPolicies Contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AllPoliciesCollection() + { + + } + } + /// The response of All Policies. + public partial interface IAllPoliciesCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// AllPolicies Contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"AllPolicies Contract value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContract[] Value { get; set; } + + } + /// The response of All Policies. + internal partial interface IAllPoliciesCollectionInternal + + { + /// Next page link if any. + string NextLink { get; set; } + /// AllPolicies Contract value. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesCollection.json.cs new file mode 100644 index 000000000000..af3d9070872c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesCollection.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of All Policies. + public partial class AllPoliciesCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AllPoliciesCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AllPoliciesContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AllPoliciesCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContract.cs new file mode 100644 index 000000000000..846f546376e6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContract.cs @@ -0,0 +1,117 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// AllPolicies Contract details. + public partial class AllPoliciesContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Policy Restriction Compliance State + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractPropertiesInternal)Property).ComplianceState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractPropertiesInternal)Property).ComplianceState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState)""); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AllPoliciesContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractProperties _property; + + /// Properties of the All Policies. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AllPoliciesContractProperties()); set => this._property = value; } + + /// Policy Identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ReferencePolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractPropertiesInternal)Property).ReferencePolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractPropertiesInternal)Property).ReferencePolicyId = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public AllPoliciesContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// AllPolicies Contract details. + public partial interface IAllPoliciesContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Policy Restriction Compliance State + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Restriction Compliance State", + SerializedName = @"complianceState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get; set; } + /// Policy Identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Identifier", + SerializedName = @"referencePolicyId", + PossibleTypes = new [] { typeof(string) })] + string ReferencePolicyId { get; set; } + + } + /// AllPolicies Contract details. + internal partial interface IAllPoliciesContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Policy Restriction Compliance State + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get; set; } + /// Properties of the All Policies. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractProperties Property { get; set; } + /// Policy Identifier + string ReferencePolicyId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContract.json.cs new file mode 100644 index 000000000000..debe19f147f4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// AllPolicies Contract details. + public partial class AllPoliciesContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AllPoliciesContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AllPoliciesContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AllPoliciesContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContractProperties.cs new file mode 100644 index 000000000000..c4e4772aa779 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContractProperties.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// AllPolicies Properties. + public partial class AllPoliciesContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? _complianceState; + + /// Policy Restriction Compliance State + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get => this._complianceState; set => this._complianceState = value; } + + /// Backing field for property. + private string _referencePolicyId; + + /// Policy Identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ReferencePolicyId { get => this._referencePolicyId; set => this._referencePolicyId = value; } + + /// Creates an new instance. + public AllPoliciesContractProperties() + { + + } + } + /// AllPolicies Properties. + public partial interface IAllPoliciesContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Policy Restriction Compliance State + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Restriction Compliance State", + SerializedName = @"complianceState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get; set; } + /// Policy Identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Identifier", + SerializedName = @"referencePolicyId", + PossibleTypes = new [] { typeof(string) })] + string ReferencePolicyId { get; set; } + + } + /// AllPolicies Properties. + internal partial interface IAllPoliciesContractPropertiesInternal + + { + /// Policy Restriction Compliance State + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get; set; } + /// Policy Identifier + string ReferencePolicyId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContractProperties.json.cs new file mode 100644 index 000000000000..0641c5f4b9a4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AllPoliciesContractProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// AllPolicies Properties. + public partial class AllPoliciesContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AllPoliciesContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_referencePolicyId = If( json?.PropertyT("referencePolicyId"), out var __jsonReferencePolicyId) ? (string)__jsonReferencePolicyId : (string)ReferencePolicyId;} + {_complianceState = If( json?.PropertyT("complianceState"), out var __jsonComplianceState) ? (string)__jsonComplianceState : (string)ComplianceState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAllPoliciesContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AllPoliciesContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._referencePolicyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._referencePolicyId.ToString()) : null, "referencePolicyId" ,container.Add ); + AddIf( null != (((object)this._complianceState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._complianceState.ToString()) : null, "complianceState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCollection.cs new file mode 100644 index 000000000000..51f39858e447 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged API list representation. + public partial class ApiCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract[] Value { get => this._value; } + + /// Creates an new instance. + public ApiCollection() + { + + } + } + /// Paged API list representation. + public partial interface IApiCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract[] Value { get; } + + } + /// Paged API list representation. + internal partial interface IApiCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCollection.json.cs new file mode 100644 index 000000000000..3694bd1bced0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged API list representation. + public partial class ApiCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContactInformation.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContactInformation.cs new file mode 100644 index 000000000000..54f7bf67360f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContactInformation.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API contact information + public partial class ApiContactInformation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformationInternal + { + + /// Backing field for property. + private string _email; + + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Email { get => this._email; set => this._email = value; } + + /// Backing field for property. + private string _name; + + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _url; + + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Url { get => this._url; set => this._url = value; } + + /// Creates an new instance. + public ApiContactInformation() + { + + } + } + /// API contact information + public partial interface IApiContactInformation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The email address of the contact person/organization. MUST be in the format of an email address", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string Email { get; set; } + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifying name of the contact person/organization", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL pointing to the contact information. MUST be in the format of a URL", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + + } + /// API contact information + internal partial interface IApiContactInformationInternal + + { + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + string Email { get; set; } + /// The identifying name of the contact person/organization + string Name { get; set; } + /// The URL pointing to the contact information. MUST be in the format of a URL + string Url { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContactInformation.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContactInformation.json.cs new file mode 100644 index 000000000000..d9dbc1b1eaf1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContactInformation.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API contact information + public partial class ApiContactInformation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiContactInformation(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)Url;} + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiContactInformation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._url)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._url.ToString()) : null, "url" ,container.Add ); + AddIf( null != (((object)this._email)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._email.ToString()) : null, "email" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContract.cs new file mode 100644 index 000000000000..b0c78d68ac1e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContract.cs @@ -0,0 +1,760 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API details. + public partial class ApiContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevision = value ?? null; } + + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiRevisionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevisionDescription = value ?? null; } + + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType)""); } + + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersion = value ?? null; } + + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionDescription = value ?? null; } + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetDescription = value ?? null; } + + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionSetId = value ?? null; } + + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetName = value ?? null; } + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetVersionHeaderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersionHeaderName = value ?? null; } + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetVersionQueryName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersionQueryName = value ?? null; } + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersioningScheme = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme)""); } + + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2AuthenticationSetting = value ?? null /* arrayOf */; } + + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenidAuthenticationSetting = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactEmail = value ?? null; } + + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactName = value ?? null; } + + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactUrl = value ?? null; } + + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Description = value ?? null; } + + /// API name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsCurrent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsCurrent = value ?? default(bool); } + + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsOnline; } + + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LicenseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseName = value ?? null; } + + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LicenseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseUrl = value ?? null; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for ApiVersionSet + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal.ApiVersionSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSet = value; } + + /// Internal Acessors for AuthenticationSetting + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal.AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSetting = value; } + + /// Internal Acessors for AuthenticationSettingOAuth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal.AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2 = value; } + + /// Internal Acessors for AuthenticationSettingOpenid + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal.AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid = value; } + + /// Internal Acessors for Contact + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal.Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Contact = value; } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsOnline = value; } + + /// Internal Acessors for License + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal.License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).License = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SubscriptionKeyParameterName + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal.SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterName = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OAuth2AuthorizationServerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2AuthorizationServerId = value ?? null; } + + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OAuth2Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2Scope = value ?? null; } + + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidBearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OpenidProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidProviderId = value ?? null; } + + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Path { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Path = value ?? null; } + + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PropertiesApiVersionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractProperties _property; + + /// API entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContractProperties()); set => this._property = value; } + + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Protocol = value ?? null /* arrayOf */; } + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ProvisioningState; } + + /// + /// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ServiceUrl = value ?? null; } + + /// API identifier of the source API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SourceApiId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).SourceApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).SourceApiId = value ?? null; } + + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SubscriptionKeyParameterNameHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameHeader = value ?? null; } + + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SubscriptionKeyParameterNameQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameQuery = value ?? null; } + + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionRequired = value ?? default(bool); } + + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TermsOfServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).TermsOfServiceUrl = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ApiContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + if (headers.TryGetValues("location", out var __locationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader1) is string __headerLocationHeader1 ? __headerLocationHeader1 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader2)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader2) is string __headerAzureAsyncOperationHeader2 ? __headerAzureAsyncOperationHeader2 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// API details. + public partial interface IApiContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes the revision of the API. If no value is provided, default revision 1 is created", + SerializedName = @"apiRevision", + PossibleTypes = new [] { typeof(string) })] + string ApiRevision { get; set; } + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API Revision.", + SerializedName = @"apiRevisionDescription", + PossibleTypes = new [] { typeof(string) })] + string ApiRevisionDescription { get; set; } + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of API.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get; set; } + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the version identifier of the API if the API is versioned", + SerializedName = @"apiVersion", + PossibleTypes = new [] { typeof(string) })] + string ApiVersion { get; set; } + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API Version.", + SerializedName = @"apiVersionDescription", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionDescription { get; set; } + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of API Version Set.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetDescription { get; set; } + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the related ApiVersionSet.", + SerializedName = @"apiVersionSetId", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetId { get; set; } + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The display Name of the API Version Set.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetName { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.", + SerializedName = @"versionHeaderName", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetVersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of query parameter that indicates the API Version if versioningScheme is set to `query`.", + SerializedName = @"versionQueryName", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetVersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An value that determines where the API Version identifier will be located in a HTTP request.", + SerializedName = @"versioningScheme", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of OAuth2 authentication settings included into this API.", + SerializedName = @"oAuth2AuthenticationSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of Open ID Connect authentication settings included into this API.", + SerializedName = @"openidAuthenticationSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The email address of the contact person/organization. MUST be in the format of an email address", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string ContactEmail { get; set; } + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifying name of the contact person/organization", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ContactName { get; set; } + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL pointing to the contact information. MUST be in the format of a URL", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string ContactUrl { get; set; } + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// API name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API name. Must be 1 to 300 characters long.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if API revision is current api revision.", + SerializedName = @"isCurrent", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCurrent { get; set; } + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if API revision is accessible via the gateway.", + SerializedName = @"isOnline", + PossibleTypes = new [] { typeof(bool) })] + bool? IsOnline { get; } + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The license name used for the API", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string LicenseName { get; set; } + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A URL to the license used for the API. MUST be in the format of a URL", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string LicenseUrl { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"authorizationServerId", + PossibleTypes = new [] { typeof(string) })] + string OAuth2AuthorizationServerId { get; set; } + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operations scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string OAuth2Scope { get; set; } + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How to send token to the server.", + SerializedName = @"bearerTokenSendingMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"openidProviderId", + PossibleTypes = new [] { typeof(string) })] + string OpenidProviderId { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier for existing API Version Set. Omit this value to create a new Version Set.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PropertiesApiVersionSetId { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes on which protocols the operations in this API can be invoked.", + SerializedName = @"protocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// + /// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.", + SerializedName = @"serviceUrl", + PossibleTypes = new [] { typeof(string) })] + string ServiceUrl { get; set; } + /// API identifier of the source API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API identifier of the source API.", + SerializedName = @"sourceApiId", + PossibleTypes = new [] { typeof(string) })] + string SourceApiId { get; set; } + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription key header name.", + SerializedName = @"header", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionKeyParameterNameHeader { get; set; } + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription key query string parameter name.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionKeyParameterNameQuery { get; set; } + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether an API or Product subscription is required for accessing the API.", + SerializedName = @"subscriptionRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionRequired { get; set; } + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @" A URL to the Terms of Service for the API. MUST be in the format of a URL.", + SerializedName = @"termsOfServiceUrl", + PossibleTypes = new [] { typeof(string) })] + string TermsOfServiceUrl { get; set; } + + } + /// API details. + internal partial interface IApiContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + string ApiRevision { get; set; } + /// Description of the API Revision. + string ApiRevisionDescription { get; set; } + /// Type of API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get; set; } + /// Indicates the version identifier of the API if the API is versioned + string ApiVersion { get; set; } + /// Description of the API Version. + string ApiVersionDescription { get; set; } + /// Version set details + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails ApiVersionSet { get; set; } + /// Description of API Version Set. + string ApiVersionSetDescription { get; set; } + /// A resource identifier for the related ApiVersionSet. + string ApiVersionSetId { get; set; } + /// The display Name of the API Version Set. + string ApiVersionSetName { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + string ApiVersionSetVersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + string ApiVersionSetVersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get; set; } + /// Collection of authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract AuthenticationSetting { get; set; } + /// OAuth2 Authentication settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// OpenID Connect Authentication Settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + + string AzureAsyncOperation { get; set; } + /// Contact information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Contact { get; set; } + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + string ContactEmail { get; set; } + /// The identifying name of the contact person/organization + string ContactName { get; set; } + /// The URL pointing to the contact information. MUST be in the format of a URL + string ContactUrl { get; set; } + /// Description of the API. May include HTML formatting tags. + string Description { get; set; } + /// API name. Must be 1 to 300 characters long. + string DisplayName { get; set; } + + string ETag { get; set; } + /// Indicates if API revision is current api revision. + bool? IsCurrent { get; set; } + /// Indicates if API revision is accessible via the gateway. + bool? IsOnline { get; set; } + /// License information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation License { get; set; } + /// The license name used for the API + string LicenseName { get; set; } + /// A URL to the license used for the API. MUST be in the format of a URL + string LicenseUrl { get; set; } + + string Location { get; set; } + /// OAuth authorization server identifier. + string OAuth2AuthorizationServerId { get; set; } + /// operations scope. + string OAuth2Scope { get; set; } + /// How to send token to the server. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + string OpenidProviderId { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + string Path { get; set; } + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + string PropertiesApiVersionSetId { get; set; } + /// API entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractProperties Property { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// + /// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. + /// + string ServiceUrl { get; set; } + /// API identifier of the source API. + string SourceApiId { get; set; } + /// Protocols over which API is made available. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get; set; } + /// Subscription key header name. + string SubscriptionKeyParameterNameHeader { get; set; } + /// Subscription key query string parameter name. + string SubscriptionKeyParameterNameQuery { get; set; } + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + bool? SubscriptionRequired { get; set; } + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + string TermsOfServiceUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContract.json.cs new file mode 100644 index 000000000000..0f28474539e6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API details. + public partial class ApiContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractProperties.cs new file mode 100644 index 000000000000..580a90801a9b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractProperties.cs @@ -0,0 +1,425 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Entity Properties + public partial class ApiContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContract __apiEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiEntityBaseContract(); + + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevision = value ?? null; } + + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiRevisionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevisionDescription = value ?? null; } + + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType)""); } + + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersion = value ?? null; } + + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionDescription = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails _apiVersionSet; + + /// Version set details + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails ApiVersionSet { get => (this._apiVersionSet = this._apiVersionSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContractDetails()); set => this._apiVersionSet = value; } + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Description = value ?? null; } + + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionSetId = value ?? null; } + + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Name = value ?? null; } + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetVersionHeaderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionHeaderName = value ?? null; } + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetVersionQueryName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionQueryName = value ?? null; } + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersioningScheme = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme)""); } + + /// Collection of authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSetting = value ?? null /* model class */; } + + /// OAuth2 Authentication settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2 = value ?? null /* model class */; } + + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2AuthenticationSetting = value ?? null /* arrayOf */; } + + /// OpenID Connect Authentication Settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenid = value ?? null /* model class */; } + + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenidAuthenticationSetting = value ?? null /* arrayOf */; } + + /// Contact information for the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Contact = value ?? null /* model class */; } + + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactEmail = value ?? null; } + + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactName = value ?? null; } + + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactUrl = value ?? null; } + + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// API name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Id = value ?? null; } + + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? IsCurrent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsCurrent = value ?? default(bool); } + + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline; } + + /// License information for the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).License = value ?? null /* model class */; } + + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string LicenseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseName = value ?? null; } + + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string LicenseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl = value ?? null; } + + /// Internal Acessors for ApiVersionSet + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal.ApiVersionSet { get => (this._apiVersionSet = this._apiVersionSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContractDetails()); set { {_apiVersionSet = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline = value; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OAuth2AuthorizationServerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2AuthorizationServerId = value ?? null; } + + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OAuth2Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2Scope = value ?? null; } + + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidBearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OpenidProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidProviderId = value ?? null; } + + /// Backing field for property. + private string _path; + + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Path { get => this._path; set => this._path = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] _protocol; + + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get => this._protocol; set => this._protocol = value; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _serviceUrl; + + /// + /// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ServiceUrl { get => this._serviceUrl; set => this._serviceUrl = value; } + + /// Backing field for property. + private string _sourceApiId; + + /// API identifier of the source API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SourceApiId { get => this._sourceApiId; set => this._sourceApiId = value; } + + /// Protocols over which API is made available. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterName = value ?? null /* model class */; } + + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SubscriptionKeyParameterNameHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameHeader = value ?? null; } + + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SubscriptionKeyParameterNameQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameQuery = value ?? null; } + + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionRequired = value ?? default(bool); } + + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string TermsOfServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).TermsOfServiceUrl = value ?? null; } + + /// Creates an new instance. + public ApiContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__apiEntityBaseContract), __apiEntityBaseContract); + await eventListener.AssertObjectIsValid(nameof(__apiEntityBaseContract), __apiEntityBaseContract); + } + } + /// API Entity Properties + public partial interface IApiContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContract + { + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of API Version Set.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetDescription { get; set; } + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The display Name of the API Version Set.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetName { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.", + SerializedName = @"versionHeaderName", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetVersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of query parameter that indicates the API Version if versioningScheme is set to `query`.", + SerializedName = @"versionQueryName", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetVersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An value that determines where the API Version identifier will be located in a HTTP request.", + SerializedName = @"versioningScheme", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get; set; } + /// API name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API name. Must be 1 to 300 characters long.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier for existing API Version Set. Omit this value to create a new Version Set.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes on which protocols the operations in this API can be invoked.", + SerializedName = @"protocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// + /// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.", + SerializedName = @"serviceUrl", + PossibleTypes = new [] { typeof(string) })] + string ServiceUrl { get; set; } + /// API identifier of the source API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API identifier of the source API.", + SerializedName = @"sourceApiId", + PossibleTypes = new [] { typeof(string) })] + string SourceApiId { get; set; } + + } + /// API Entity Properties + internal partial interface IApiContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal + { + /// Version set details + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails ApiVersionSet { get; set; } + /// Description of API Version Set. + string ApiVersionSetDescription { get; set; } + /// The display Name of the API Version Set. + string ApiVersionSetName { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + string ApiVersionSetVersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + string ApiVersionSetVersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get; set; } + /// API name. Must be 1 to 300 characters long. + string DisplayName { get; set; } + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + string Id { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + string Path { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// + /// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. + /// + string ServiceUrl { get; set; } + /// API identifier of the source API. + string SourceApiId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractProperties.json.cs new file mode 100644 index 000000000000..fe6b67ae699a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractProperties.json.cs @@ -0,0 +1,133 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Entity Properties + public partial class ApiContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __apiEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiEntityBaseContract(json); + {_apiVersionSet = If( json?.PropertyT("apiVersionSet"), out var __jsonApiVersionSet) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContractDetails.FromJson(__jsonApiVersionSet) : ApiVersionSet;} + {_sourceApiId = If( json?.PropertyT("sourceApiId"), out var __jsonSourceApiId) ? (string)__jsonSourceApiId : (string)SourceApiId;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_serviceUrl = If( json?.PropertyT("serviceUrl"), out var __jsonServiceUrl) ? (string)__jsonServiceUrl : (string)ServiceUrl;} + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + {_protocol = If( json?.PropertyT("protocols"), out var __jsonProtocols) ? If( __jsonProtocols as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol)""))) ))() : null : Protocol;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __apiEntityBaseContract?.ToJson(container, serializationMode); + AddIf( null != this._apiVersionSet ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._apiVersionSet.ToJson(null,serializationMode) : null, "apiVersionSet" ,container.Add ); + AddIf( null != (((object)this._sourceApiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._sourceApiId.ToString()) : null, "sourceApiId" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._serviceUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._serviceUrl.ToString()) : null, "serviceUrl" ,container.Add ); + AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); + if (null != this._protocol) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._protocol ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("protocols",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractUpdateProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractUpdateProperties.cs new file mode 100644 index 000000000000..3ebbb7c3d31c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractUpdateProperties.cs @@ -0,0 +1,262 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API update contract properties. + public partial class ApiContractUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdatePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContract __apiEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiEntityBaseContract(); + + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevision = value ?? null; } + + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiRevisionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevisionDescription = value ?? null; } + + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType)""); } + + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersion = value ?? null; } + + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionDescription = value ?? null; } + + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionSetId = value ?? null; } + + /// Collection of authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSetting = value ?? null /* model class */; } + + /// OAuth2 Authentication settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2 = value ?? null /* model class */; } + + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2AuthenticationSetting = value ?? null /* arrayOf */; } + + /// OpenID Connect Authentication Settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenid = value ?? null /* model class */; } + + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenidAuthenticationSetting = value ?? null /* arrayOf */; } + + /// Contact information for the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Contact = value ?? null /* model class */; } + + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactEmail = value ?? null; } + + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactName = value ?? null; } + + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactUrl = value ?? null; } + + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// API name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? IsCurrent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsCurrent = value ?? default(bool); } + + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline; } + + /// License information for the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).License = value ?? null /* model class */; } + + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string LicenseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseName = value ?? null; } + + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string LicenseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl = value ?? null; } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline = value; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OAuth2AuthorizationServerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2AuthorizationServerId = value ?? null; } + + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OAuth2Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2Scope = value ?? null; } + + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidBearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OpenidProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidProviderId = value ?? null; } + + /// Backing field for property. + private string _path; + + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Path { get => this._path; set => this._path = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] _protocol; + + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get => this._protocol; set => this._protocol = value; } + + /// Backing field for property. + private string _serviceUrl; + + /// Absolute URL of the backend service implementing this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ServiceUrl { get => this._serviceUrl; set => this._serviceUrl = value; } + + /// Protocols over which API is made available. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterName = value ?? null /* model class */; } + + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SubscriptionKeyParameterNameHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameHeader = value ?? null; } + + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SubscriptionKeyParameterNameQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameQuery = value ?? null; } + + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionRequired = value ?? default(bool); } + + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string TermsOfServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).TermsOfServiceUrl = value ?? null; } + + /// Creates an new instance. + public ApiContractUpdateProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__apiEntityBaseContract), __apiEntityBaseContract); + await eventListener.AssertObjectIsValid(nameof(__apiEntityBaseContract), __apiEntityBaseContract); + } + } + /// API update contract properties. + public partial interface IApiContractUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContract + { + /// API name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes on which protocols the operations in this API can be invoked.", + SerializedName = @"protocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// Absolute URL of the backend service implementing this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Absolute URL of the backend service implementing this API.", + SerializedName = @"serviceUrl", + PossibleTypes = new [] { typeof(string) })] + string ServiceUrl { get; set; } + + } + /// API update contract properties. + internal partial interface IApiContractUpdatePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal + { + /// API name. + string DisplayName { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + string Path { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// Absolute URL of the backend service implementing this API. + string ServiceUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractUpdateProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractUpdateProperties.json.cs new file mode 100644 index 000000000000..de73f186840a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiContractUpdateProperties.json.cs @@ -0,0 +1,124 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API update contract properties. + public partial class ApiContractUpdateProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiContractUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __apiEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiEntityBaseContract(json); + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_serviceUrl = If( json?.PropertyT("serviceUrl"), out var __jsonServiceUrl) ? (string)__jsonServiceUrl : (string)ServiceUrl;} + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + {_protocol = If( json?.PropertyT("protocols"), out var __jsonProtocols) ? If( __jsonProtocols as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol)""))) ))() : null : Protocol;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiContractUpdateProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __apiEntityBaseContract?.ToJson(container, serializationMode); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._serviceUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._serviceUrl.ToString()) : null, "serviceUrl" ,container.Add ); + AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); + if (null != this._protocol) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._protocol ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("protocols",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateParameter.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateParameter.cs new file mode 100644 index 000000000000..966370077b59 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateParameter.cs @@ -0,0 +1,781 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Create or Update Parameters. + public partial class ApiCreateOrUpdateParameter : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameter, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal + { + + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevision = value ?? null; } + + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiRevisionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevisionDescription = value ?? null; } + + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType)""); } + + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersion = value ?? null; } + + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionDescription = value ?? null; } + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetDescription = value ?? null; } + + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionSetId = value ?? null; } + + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetName = value ?? null; } + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetVersionHeaderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersionHeaderName = value ?? null; } + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetVersionQueryName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersionQueryName = value ?? null; } + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSetVersioningScheme = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme)""); } + + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2AuthenticationSetting = value ?? null /* arrayOf */; } + + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenidAuthenticationSetting = value ?? null /* arrayOf */; } + + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactEmail = value ?? null; } + + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactName = value ?? null; } + + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactUrl = value ?? null; } + + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Description = value ?? null; } + + /// API name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// + /// Format of the Content in which the API is getting imported. New formats can be added in the future + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat? Format { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).Format = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat)""); } + + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Id = value ?? null; } + + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsCurrent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsCurrent = value ?? default(bool); } + + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsOnline; } + + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LicenseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseName = value ?? null; } + + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LicenseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseUrl = value ?? null; } + + /// Internal Acessors for ApiVersionSet + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.ApiVersionSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ApiVersionSet = value; } + + /// Internal Acessors for AuthenticationSetting + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSetting = value; } + + /// Internal Acessors for AuthenticationSettingOAuth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2 = value; } + + /// Internal Acessors for AuthenticationSettingOpenid + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid = value; } + + /// Internal Acessors for Contact + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Contact = value; } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsOnline = value; } + + /// Internal Acessors for License + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).License = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiCreateOrUpdateProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SubscriptionKeyParameterName + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterName = value; } + + /// Internal Acessors for WsdlSelector + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelector Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameterInternal.WsdlSelector { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).WsdlSelector; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).WsdlSelector = value; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OAuth2AuthorizationServerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2AuthorizationServerId = value ?? null; } + + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OAuth2Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2Scope = value ?? null; } + + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidBearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OpenidProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidProviderId = value ?? null; } + + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Path { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Path = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateProperties _property; + + /// API entity create of update properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiCreateOrUpdateProperties()); set => this._property = value; } + + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).Protocol = value ?? null /* arrayOf */; } + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ProvisioningState; } + + /// + /// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).ServiceUrl = value ?? null; } + + /// + /// Type of API to create. + /// * `http` creates a REST API + /// * `soap` creates a SOAP pass-through API + /// * `websocket` creates websocket API + /// * `graphql` creates GraphQL API. + /// New types can be added in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType? SoapApiType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).SoapApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).SoapApiType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType)""); } + + /// API identifier of the source API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SourceApiId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).SourceApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)Property).SourceApiId = value ?? null; } + + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SubscriptionKeyParameterNameHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameHeader = value ?? null; } + + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SubscriptionKeyParameterNameQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameQuery = value ?? null; } + + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionRequired = value ?? default(bool); } + + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TermsOfServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).TermsOfServiceUrl = value ?? null; } + + /// + /// Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: + /// 'template', 'query' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct? TranslateRequiredQueryParametersConduct { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).TranslateRequiredQueryParametersConduct; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).TranslateRequiredQueryParametersConduct = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct)""); } + + /// Content value when Importing an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).Value = value ?? null; } + + /// Name of endpoint(port) to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string WsdlSelectorWsdlEndpointName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).WsdlSelectorWsdlEndpointName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).WsdlSelectorWsdlEndpointName = value ?? null; } + + /// Name of service to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string WsdlSelectorWsdlServiceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).WsdlSelectorWsdlServiceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal)Property).WsdlSelectorWsdlServiceName = value ?? null; } + + /// Creates an new instance. + public ApiCreateOrUpdateParameter() + { + + } + } + /// API Create or Update Parameters. + public partial interface IApiCreateOrUpdateParameter : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes the revision of the API. If no value is provided, default revision 1 is created", + SerializedName = @"apiRevision", + PossibleTypes = new [] { typeof(string) })] + string ApiRevision { get; set; } + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API Revision.", + SerializedName = @"apiRevisionDescription", + PossibleTypes = new [] { typeof(string) })] + string ApiRevisionDescription { get; set; } + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of API.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get; set; } + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the version identifier of the API if the API is versioned", + SerializedName = @"apiVersion", + PossibleTypes = new [] { typeof(string) })] + string ApiVersion { get; set; } + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API Version.", + SerializedName = @"apiVersionDescription", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionDescription { get; set; } + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of API Version Set.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetDescription { get; set; } + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the related ApiVersionSet.", + SerializedName = @"apiVersionSetId", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetId { get; set; } + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The display Name of the API Version Set.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetName { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.", + SerializedName = @"versionHeaderName", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetVersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of query parameter that indicates the API Version if versioningScheme is set to `query`.", + SerializedName = @"versionQueryName", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetVersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An value that determines where the API Version identifier will be located in a HTTP request.", + SerializedName = @"versioningScheme", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of OAuth2 authentication settings included into this API.", + SerializedName = @"oAuth2AuthenticationSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of Open ID Connect authentication settings included into this API.", + SerializedName = @"openidAuthenticationSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The email address of the contact person/organization. MUST be in the format of an email address", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string ContactEmail { get; set; } + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifying name of the contact person/organization", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ContactName { get; set; } + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL pointing to the contact information. MUST be in the format of a URL", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string ContactUrl { get; set; } + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// API name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API name. Must be 1 to 300 characters long.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Format of the Content in which the API is getting imported. New formats can be added in the future + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Format of the Content in which the API is getting imported. New formats can be added in the future", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat? Format { get; set; } + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier for existing API Version Set. Omit this value to create a new Version Set.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if API revision is current api revision.", + SerializedName = @"isCurrent", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCurrent { get; set; } + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if API revision is accessible via the gateway.", + SerializedName = @"isOnline", + PossibleTypes = new [] { typeof(bool) })] + bool? IsOnline { get; } + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The license name used for the API", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string LicenseName { get; set; } + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A URL to the license used for the API. MUST be in the format of a URL", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string LicenseUrl { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"authorizationServerId", + PossibleTypes = new [] { typeof(string) })] + string OAuth2AuthorizationServerId { get; set; } + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operations scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string OAuth2Scope { get; set; } + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How to send token to the server.", + SerializedName = @"bearerTokenSendingMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"openidProviderId", + PossibleTypes = new [] { typeof(string) })] + string OpenidProviderId { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes on which protocols the operations in this API can be invoked.", + SerializedName = @"protocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// + /// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.", + SerializedName = @"serviceUrl", + PossibleTypes = new [] { typeof(string) })] + string ServiceUrl { get; set; } + /// + /// Type of API to create. + /// * `http` creates a REST API + /// * `soap` creates a SOAP pass-through API + /// * `websocket` creates websocket API + /// * `graphql` creates GraphQL API. + /// New types can be added in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of API to create. + * `http` creates a REST API + * `soap` creates a SOAP pass-through API + * `websocket` creates websocket API + * `graphql` creates GraphQL API. + New types can be added in the future.", + SerializedName = @"apiType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType? SoapApiType { get; set; } + /// API identifier of the source API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API identifier of the source API.", + SerializedName = @"sourceApiId", + PossibleTypes = new [] { typeof(string) })] + string SourceApiId { get; set; } + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription key header name.", + SerializedName = @"header", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionKeyParameterNameHeader { get; set; } + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription key query string parameter name.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionKeyParameterNameQuery { get; set; } + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether an API or Product subscription is required for accessing the API.", + SerializedName = @"subscriptionRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionRequired { get; set; } + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @" A URL to the Terms of Service for the API. MUST be in the format of a URL.", + SerializedName = @"termsOfServiceUrl", + PossibleTypes = new [] { typeof(string) })] + string TermsOfServiceUrl { get; set; } + /// + /// Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: + /// 'template', 'query' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: 'template', 'query'", + SerializedName = @"translateRequiredQueryParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct? TranslateRequiredQueryParametersConduct { get; set; } + /// Content value when Importing an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content value when Importing an API.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + /// Name of endpoint(port) to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of endpoint(port) to import from WSDL", + SerializedName = @"wsdlEndpointName", + PossibleTypes = new [] { typeof(string) })] + string WsdlSelectorWsdlEndpointName { get; set; } + /// Name of service to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of service to import from WSDL", + SerializedName = @"wsdlServiceName", + PossibleTypes = new [] { typeof(string) })] + string WsdlSelectorWsdlServiceName { get; set; } + + } + /// API Create or Update Parameters. + internal partial interface IApiCreateOrUpdateParameterInternal + + { + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + string ApiRevision { get; set; } + /// Description of the API Revision. + string ApiRevisionDescription { get; set; } + /// Type of API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get; set; } + /// Indicates the version identifier of the API if the API is versioned + string ApiVersion { get; set; } + /// Description of the API Version. + string ApiVersionDescription { get; set; } + /// Version set details + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails ApiVersionSet { get; set; } + /// Description of API Version Set. + string ApiVersionSetDescription { get; set; } + /// A resource identifier for the related ApiVersionSet. + string ApiVersionSetId { get; set; } + /// The display Name of the API Version Set. + string ApiVersionSetName { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + string ApiVersionSetVersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + string ApiVersionSetVersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get; set; } + /// Collection of authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract AuthenticationSetting { get; set; } + /// OAuth2 Authentication settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// OpenID Connect Authentication Settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + /// Contact information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Contact { get; set; } + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + string ContactEmail { get; set; } + /// The identifying name of the contact person/organization + string ContactName { get; set; } + /// The URL pointing to the contact information. MUST be in the format of a URL + string ContactUrl { get; set; } + /// Description of the API. May include HTML formatting tags. + string Description { get; set; } + /// API name. Must be 1 to 300 characters long. + string DisplayName { get; set; } + /// + /// Format of the Content in which the API is getting imported. New formats can be added in the future + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat? Format { get; set; } + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + string Id { get; set; } + /// Indicates if API revision is current api revision. + bool? IsCurrent { get; set; } + /// Indicates if API revision is accessible via the gateway. + bool? IsOnline { get; set; } + /// License information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation License { get; set; } + /// The license name used for the API + string LicenseName { get; set; } + /// A URL to the license used for the API. MUST be in the format of a URL + string LicenseUrl { get; set; } + /// OAuth authorization server identifier. + string OAuth2AuthorizationServerId { get; set; } + /// operations scope. + string OAuth2Scope { get; set; } + /// How to send token to the server. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + string OpenidProviderId { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + string Path { get; set; } + /// API entity create of update properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateProperties Property { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// + /// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. + /// + string ServiceUrl { get; set; } + /// + /// Type of API to create. + /// * `http` creates a REST API + /// * `soap` creates a SOAP pass-through API + /// * `websocket` creates websocket API + /// * `graphql` creates GraphQL API. + /// New types can be added in the future. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType? SoapApiType { get; set; } + /// API identifier of the source API. + string SourceApiId { get; set; } + /// Protocols over which API is made available. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get; set; } + /// Subscription key header name. + string SubscriptionKeyParameterNameHeader { get; set; } + /// Subscription key query string parameter name. + string SubscriptionKeyParameterNameQuery { get; set; } + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + bool? SubscriptionRequired { get; set; } + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + string TermsOfServiceUrl { get; set; } + /// + /// Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: + /// 'template', 'query' + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct? TranslateRequiredQueryParametersConduct { get; set; } + /// Content value when Importing an API. + string Value { get; set; } + /// Criteria to limit import of WSDL to a subset of the document. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelector WsdlSelector { get; set; } + /// Name of endpoint(port) to import from WSDL + string WsdlSelectorWsdlEndpointName { get; set; } + /// Name of service to import from WSDL + string WsdlSelectorWsdlServiceName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateParameter.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateParameter.json.cs new file mode 100644 index 000000000000..e2aa36189591 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateParameter.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Create or Update Parameters. + public partial class ApiCreateOrUpdateParameter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiCreateOrUpdateParameter(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiCreateOrUpdateProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiCreateOrUpdateParameter(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateProperties.cs new file mode 100644 index 000000000000..466c727157ae --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateProperties.cs @@ -0,0 +1,402 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Create or Update Properties. + public partial class ApiCreateOrUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractProperties __apiContractProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContractProperties(); + + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiRevision = value ?? null; } + + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiRevisionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiRevisionDescription = value ?? null; } + + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType)""); } + + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiVersion = value ?? null; } + + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiVersionDescription = value ?? null; } + + /// Version set details + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails ApiVersionSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSet = value ?? null /* model class */; } + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionSetDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetDescription = value ?? null; } + + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ApiVersionSetId = value ?? null; } + + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetName = value ?? null; } + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionSetVersionHeaderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetVersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetVersionHeaderName = value ?? null; } + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionSetVersionQueryName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetVersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetVersionQueryName = value ?? null; } + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetVersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ApiVersionSetVersioningScheme = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme)""); } + + /// Collection of authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSetting = value ?? null /* model class */; } + + /// OAuth2 Authentication settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOAuth2 = value ?? null /* model class */; } + + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOAuth2AuthenticationSetting = value ?? null /* arrayOf */; } + + /// OpenID Connect Authentication Settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOpenid = value ?? null /* model class */; } + + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).AuthenticationSettingOpenidAuthenticationSetting = value ?? null /* arrayOf */; } + + /// Contact information for the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).Contact = value ?? null /* model class */; } + + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ContactEmail = value ?? null; } + + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ContactName = value ?? null; } + + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).ContactUrl = value ?? null; } + + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).Description = value ?? null; } + + /// API name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).DisplayName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat? _format; + + /// + /// Format of the Content in which the API is getting imported. New formats can be added in the future + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat? Format { get => this._format; set => this._format = value; } + + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).Id = value ?? null; } + + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? IsCurrent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).IsCurrent = value ?? default(bool); } + + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).IsOnline; } + + /// License information for the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).License = value ?? null /* model class */; } + + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string LicenseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).LicenseName = value ?? null; } + + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string LicenseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).LicenseUrl = value ?? null; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ProvisioningState = value; } + + /// Internal Acessors for WsdlSelector + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelector Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesInternal.WsdlSelector { get => (this._wsdlSelector = this._wsdlSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiCreateOrUpdatePropertiesWsdlSelector()); set { {_wsdlSelector = value;} } } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).IsOnline = value; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OAuth2AuthorizationServerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).OAuth2AuthorizationServerId = value ?? null; } + + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OAuth2Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).OAuth2Scope = value ?? null; } + + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).OpenidBearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OpenidProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).OpenidProviderId = value ?? null; } + + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Path { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).Path = value ; } + + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).Protocol = value ?? null /* arrayOf */; } + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ProvisioningState; } + + /// + /// Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).ServiceUrl = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType? _soapApiType; + + /// + /// Type of API to create. + /// * `http` creates a REST API + /// * `soap` creates a SOAP pass-through API + /// * `websocket` creates websocket API + /// * `graphql` creates GraphQL API. + /// New types can be added in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType? SoapApiType { get => this._soapApiType; set => this._soapApiType = value; } + + /// API identifier of the source API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SourceApiId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).SourceApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal)__apiContractProperties).SourceApiId = value ?? null; } + + /// Protocols over which API is made available. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionKeyParameterName = value ?? null /* model class */; } + + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SubscriptionKeyParameterNameHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionKeyParameterNameHeader = value ?? null; } + + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SubscriptionKeyParameterNameQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionKeyParameterNameQuery = value ?? null; } + + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).SubscriptionRequired = value ?? default(bool); } + + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string TermsOfServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiContractProperties).TermsOfServiceUrl = value ?? null; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct? _translateRequiredQueryParametersConduct; + + /// + /// Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: + /// 'template', 'query' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct? TranslateRequiredQueryParametersConduct { get => this._translateRequiredQueryParametersConduct; set => this._translateRequiredQueryParametersConduct = value; } + + /// Backing field for property. + private string _value; + + /// Content value when Importing an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelector _wsdlSelector; + + /// Criteria to limit import of WSDL to a subset of the document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelector WsdlSelector { get => (this._wsdlSelector = this._wsdlSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiCreateOrUpdatePropertiesWsdlSelector()); set => this._wsdlSelector = value; } + + /// Name of endpoint(port) to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string WsdlSelectorWsdlEndpointName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelectorInternal)WsdlSelector).WsdlEndpointName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelectorInternal)WsdlSelector).WsdlEndpointName = value ?? null; } + + /// Name of service to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string WsdlSelectorWsdlServiceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelectorInternal)WsdlSelector).WsdlServiceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelectorInternal)WsdlSelector).WsdlServiceName = value ?? null; } + + /// Creates an new instance. + public ApiCreateOrUpdateProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__apiContractProperties), __apiContractProperties); + await eventListener.AssertObjectIsValid(nameof(__apiContractProperties), __apiContractProperties); + } + } + /// API Create or Update Properties. + public partial interface IApiCreateOrUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractProperties + { + /// + /// Format of the Content in which the API is getting imported. New formats can be added in the future + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Format of the Content in which the API is getting imported. New formats can be added in the future", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat? Format { get; set; } + /// + /// Type of API to create. + /// * `http` creates a REST API + /// * `soap` creates a SOAP pass-through API + /// * `websocket` creates websocket API + /// * `graphql` creates GraphQL API. + /// New types can be added in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of API to create. + * `http` creates a REST API + * `soap` creates a SOAP pass-through API + * `websocket` creates websocket API + * `graphql` creates GraphQL API. + New types can be added in the future.", + SerializedName = @"apiType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType? SoapApiType { get; set; } + /// + /// Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: + /// 'template', 'query' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: 'template', 'query'", + SerializedName = @"translateRequiredQueryParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct? TranslateRequiredQueryParametersConduct { get; set; } + /// Content value when Importing an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content value when Importing an API.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + /// Name of endpoint(port) to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of endpoint(port) to import from WSDL", + SerializedName = @"wsdlEndpointName", + PossibleTypes = new [] { typeof(string) })] + string WsdlSelectorWsdlEndpointName { get; set; } + /// Name of service to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of service to import from WSDL", + SerializedName = @"wsdlServiceName", + PossibleTypes = new [] { typeof(string) })] + string WsdlSelectorWsdlServiceName { get; set; } + + } + /// API Create or Update Properties. + internal partial interface IApiCreateOrUpdatePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractPropertiesInternal + { + /// + /// Format of the Content in which the API is getting imported. New formats can be added in the future + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat? Format { get; set; } + /// + /// Type of API to create. + /// * `http` creates a REST API + /// * `soap` creates a SOAP pass-through API + /// * `websocket` creates websocket API + /// * `graphql` creates GraphQL API. + /// New types can be added in the future. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType? SoapApiType { get; set; } + /// + /// Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: + /// 'template', 'query' + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct? TranslateRequiredQueryParametersConduct { get; set; } + /// Content value when Importing an API. + string Value { get; set; } + /// Criteria to limit import of WSDL to a subset of the document. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelector WsdlSelector { get; set; } + /// Name of endpoint(port) to import from WSDL + string WsdlSelectorWsdlEndpointName { get; set; } + /// Name of service to import from WSDL + string WsdlSelectorWsdlServiceName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateProperties.json.cs new file mode 100644 index 000000000000..666e66de9403 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdateProperties.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Create or Update Properties. + public partial class ApiCreateOrUpdateProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiCreateOrUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __apiContractProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContractProperties(json); + {_wsdlSelector = If( json?.PropertyT("wsdlSelector"), out var __jsonWsdlSelector) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiCreateOrUpdatePropertiesWsdlSelector.FromJson(__jsonWsdlSelector) : WsdlSelector;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_format = If( json?.PropertyT("format"), out var __jsonFormat) ? (string)__jsonFormat : (string)Format;} + {_soapApiType = If( json?.PropertyT("apiType"), out var __jsonApiType) ? (string)__jsonApiType : (string)SoapApiType;} + {_translateRequiredQueryParametersConduct = If( json?.PropertyT("translateRequiredQueryParameters"), out var __jsonTranslateRequiredQueryParameters) ? (string)__jsonTranslateRequiredQueryParameters : (string)TranslateRequiredQueryParametersConduct;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiCreateOrUpdateProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __apiContractProperties?.ToJson(container, serializationMode); + AddIf( null != this._wsdlSelector ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._wsdlSelector.ToJson(null,serializationMode) : null, "wsdlSelector" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != (((object)this._format)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._format.ToString()) : null, "format" ,container.Add ); + AddIf( null != (((object)this._soapApiType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._soapApiType.ToString()) : null, "apiType" ,container.Add ); + AddIf( null != (((object)this._translateRequiredQueryParametersConduct)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._translateRequiredQueryParametersConduct.ToString()) : null, "translateRequiredQueryParameters" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdatePropertiesWsdlSelector.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdatePropertiesWsdlSelector.cs new file mode 100644 index 000000000000..d5dedd1e91ac --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdatePropertiesWsdlSelector.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Criteria to limit import of WSDL to a subset of the document. + public partial class ApiCreateOrUpdatePropertiesWsdlSelector : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelector, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelectorInternal + { + + /// Backing field for property. + private string _wsdlEndpointName; + + /// Name of endpoint(port) to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string WsdlEndpointName { get => this._wsdlEndpointName; set => this._wsdlEndpointName = value; } + + /// Backing field for property. + private string _wsdlServiceName; + + /// Name of service to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string WsdlServiceName { get => this._wsdlServiceName; set => this._wsdlServiceName = value; } + + /// Creates an new instance. + public ApiCreateOrUpdatePropertiesWsdlSelector() + { + + } + } + /// Criteria to limit import of WSDL to a subset of the document. + public partial interface IApiCreateOrUpdatePropertiesWsdlSelector : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Name of endpoint(port) to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of endpoint(port) to import from WSDL", + SerializedName = @"wsdlEndpointName", + PossibleTypes = new [] { typeof(string) })] + string WsdlEndpointName { get; set; } + /// Name of service to import from WSDL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of service to import from WSDL", + SerializedName = @"wsdlServiceName", + PossibleTypes = new [] { typeof(string) })] + string WsdlServiceName { get; set; } + + } + /// Criteria to limit import of WSDL to a subset of the document. + internal partial interface IApiCreateOrUpdatePropertiesWsdlSelectorInternal + + { + /// Name of endpoint(port) to import from WSDL + string WsdlEndpointName { get; set; } + /// Name of service to import from WSDL + string WsdlServiceName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdatePropertiesWsdlSelector.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdatePropertiesWsdlSelector.json.cs new file mode 100644 index 000000000000..a6d34272f3db --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiCreateOrUpdatePropertiesWsdlSelector.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Criteria to limit import of WSDL to a subset of the document. + public partial class ApiCreateOrUpdatePropertiesWsdlSelector + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiCreateOrUpdatePropertiesWsdlSelector(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_wsdlServiceName = If( json?.PropertyT("wsdlServiceName"), out var __jsonWsdlServiceName) ? (string)__jsonWsdlServiceName : (string)WsdlServiceName;} + {_wsdlEndpointName = If( json?.PropertyT("wsdlEndpointName"), out var __jsonWsdlEndpointName) ? (string)__jsonWsdlEndpointName : (string)WsdlEndpointName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelector. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelector. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiCreateOrUpdatePropertiesWsdlSelector FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiCreateOrUpdatePropertiesWsdlSelector(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._wsdlServiceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._wsdlServiceName.ToString()) : null, "wsdlServiceName" ,container.Add ); + AddIf( null != (((object)this._wsdlEndpointName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._wsdlEndpointName.ToString()) : null, "wsdlEndpointName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiEntityBaseContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiEntityBaseContract.cs new file mode 100644 index 000000000000..82cac219edc0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiEntityBaseContract.cs @@ -0,0 +1,482 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API base contract details. + public partial class ApiEntityBaseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal + { + + /// Backing field for property. + private string _apiRevision; + + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiRevision { get => this._apiRevision; set => this._apiRevision = value; } + + /// Backing field for property. + private string _apiRevisionDescription; + + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiRevisionDescription { get => this._apiRevisionDescription; set => this._apiRevisionDescription = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? _apiType; + + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get => this._apiType; set => this._apiType = value; } + + /// Backing field for property. + private string _apiVersion; + + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiVersion { get => this._apiVersion; set => this._apiVersion = value; } + + /// Backing field for property. + private string _apiVersionDescription; + + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiVersionDescription { get => this._apiVersionDescription; set => this._apiVersionDescription = value; } + + /// Backing field for property. + private string _apiVersionSetId; + + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiVersionSetId { get => this._apiVersionSetId; set => this._apiVersionSetId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract _authenticationSetting; + + /// Collection of authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract AuthenticationSetting { get => (this._authenticationSetting = this._authenticationSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthenticationSettingsContract()); set => this._authenticationSetting = value; } + + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2AuthenticationSetting = value ?? null /* arrayOf */; } + + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidAuthenticationSetting = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation _contact; + + /// Contact information for the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Contact { get => (this._contact = this._contact ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContactInformation()); set => this._contact = value; } + + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformationInternal)Contact).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformationInternal)Contact).Email = value ?? null; } + + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformationInternal)Contact).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformationInternal)Contact).Name = value ?? null; } + + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformationInternal)Contact).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformationInternal)Contact).Url = value ?? null; } + + /// Backing field for property. + private string _description; + + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private bool? _isCurrent; + + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsCurrent { get => this._isCurrent; set => this._isCurrent = value; } + + /// Backing field for property. + private bool? _isOnline; + + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsOnline { get => this._isOnline; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation _license; + + /// License information for the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation License { get => (this._license = this._license ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiLicenseInformation()); set => this._license = value; } + + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LicenseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformationInternal)License).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformationInternal)License).Name = value ?? null; } + + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LicenseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformationInternal)License).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformationInternal)License).Url = value ?? null; } + + /// Internal Acessors for AuthenticationSetting + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.AuthenticationSetting { get => (this._authenticationSetting = this._authenticationSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthenticationSettingsContract()); set { {_authenticationSetting = value;} } } + + /// Internal Acessors for AuthenticationSettingOAuth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2 = value; } + + /// Internal Acessors for AuthenticationSettingOpenid + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).Openid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).Openid = value; } + + /// Internal Acessors for Contact + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.Contact { get => (this._contact = this._contact ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContactInformation()); set { {_contact = value;} } } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.IsOnline { get => this._isOnline; set { {_isOnline = value;} } } + + /// Internal Acessors for License + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.License { get => (this._license = this._license ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiLicenseInformation()); set { {_license = value;} } } + + /// Internal Acessors for SubscriptionKeyParameterName + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.SubscriptionKeyParameterName { get => (this._subscriptionKeyParameterName = this._subscriptionKeyParameterName ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionKeyParameterNamesContract()); set { {_subscriptionKeyParameterName = value;} } } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OAuth2AuthorizationServerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2AuthorizationServerId = value ?? null; } + + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OAuth2Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OAuth2Scope = value ?? null; } + + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidBearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OpenidProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal)AuthenticationSetting).OpenidProviderId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract _subscriptionKeyParameterName; + + /// Protocols over which API is made available. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get => (this._subscriptionKeyParameterName = this._subscriptionKeyParameterName ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionKeyParameterNamesContract()); set => this._subscriptionKeyParameterName = value; } + + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SubscriptionKeyParameterNameHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContractInternal)SubscriptionKeyParameterName).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContractInternal)SubscriptionKeyParameterName).Header = value ?? null; } + + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SubscriptionKeyParameterNameQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContractInternal)SubscriptionKeyParameterName).Query; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContractInternal)SubscriptionKeyParameterName).Query = value ?? null; } + + /// Backing field for property. + private bool? _subscriptionRequired; + + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? SubscriptionRequired { get => this._subscriptionRequired; set => this._subscriptionRequired = value; } + + /// Backing field for property. + private string _termsOfServiceUrl; + + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TermsOfServiceUrl { get => this._termsOfServiceUrl; set => this._termsOfServiceUrl = value; } + + /// Creates an new instance. + public ApiEntityBaseContract() + { + + } + } + /// API base contract details. + public partial interface IApiEntityBaseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes the revision of the API. If no value is provided, default revision 1 is created", + SerializedName = @"apiRevision", + PossibleTypes = new [] { typeof(string) })] + string ApiRevision { get; set; } + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API Revision.", + SerializedName = @"apiRevisionDescription", + PossibleTypes = new [] { typeof(string) })] + string ApiRevisionDescription { get; set; } + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of API.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get; set; } + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the version identifier of the API if the API is versioned", + SerializedName = @"apiVersion", + PossibleTypes = new [] { typeof(string) })] + string ApiVersion { get; set; } + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API Version.", + SerializedName = @"apiVersionDescription", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionDescription { get; set; } + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the related ApiVersionSet.", + SerializedName = @"apiVersionSetId", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetId { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of OAuth2 authentication settings included into this API.", + SerializedName = @"oAuth2AuthenticationSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of Open ID Connect authentication settings included into this API.", + SerializedName = @"openidAuthenticationSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The email address of the contact person/organization. MUST be in the format of an email address", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string ContactEmail { get; set; } + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifying name of the contact person/organization", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ContactName { get; set; } + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL pointing to the contact information. MUST be in the format of a URL", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string ContactUrl { get; set; } + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if API revision is current api revision.", + SerializedName = @"isCurrent", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCurrent { get; set; } + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if API revision is accessible via the gateway.", + SerializedName = @"isOnline", + PossibleTypes = new [] { typeof(bool) })] + bool? IsOnline { get; } + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The license name used for the API", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string LicenseName { get; set; } + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A URL to the license used for the API. MUST be in the format of a URL", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string LicenseUrl { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"authorizationServerId", + PossibleTypes = new [] { typeof(string) })] + string OAuth2AuthorizationServerId { get; set; } + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operations scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string OAuth2Scope { get; set; } + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How to send token to the server.", + SerializedName = @"bearerTokenSendingMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"openidProviderId", + PossibleTypes = new [] { typeof(string) })] + string OpenidProviderId { get; set; } + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription key header name.", + SerializedName = @"header", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionKeyParameterNameHeader { get; set; } + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription key query string parameter name.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionKeyParameterNameQuery { get; set; } + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether an API or Product subscription is required for accessing the API.", + SerializedName = @"subscriptionRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionRequired { get; set; } + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @" A URL to the Terms of Service for the API. MUST be in the format of a URL.", + SerializedName = @"termsOfServiceUrl", + PossibleTypes = new [] { typeof(string) })] + string TermsOfServiceUrl { get; set; } + + } + /// API base contract details. + internal partial interface IApiEntityBaseContractInternal + + { + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + string ApiRevision { get; set; } + /// Description of the API Revision. + string ApiRevisionDescription { get; set; } + /// Type of API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get; set; } + /// Indicates the version identifier of the API if the API is versioned + string ApiVersion { get; set; } + /// Description of the API Version. + string ApiVersionDescription { get; set; } + /// A resource identifier for the related ApiVersionSet. + string ApiVersionSetId { get; set; } + /// Collection of authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract AuthenticationSetting { get; set; } + /// OAuth2 Authentication settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// OpenID Connect Authentication Settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + /// Contact information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Contact { get; set; } + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + string ContactEmail { get; set; } + /// The identifying name of the contact person/organization + string ContactName { get; set; } + /// The URL pointing to the contact information. MUST be in the format of a URL + string ContactUrl { get; set; } + /// Description of the API. May include HTML formatting tags. + string Description { get; set; } + /// Indicates if API revision is current api revision. + bool? IsCurrent { get; set; } + /// Indicates if API revision is accessible via the gateway. + bool? IsOnline { get; set; } + /// License information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation License { get; set; } + /// The license name used for the API + string LicenseName { get; set; } + /// A URL to the license used for the API. MUST be in the format of a URL + string LicenseUrl { get; set; } + /// OAuth authorization server identifier. + string OAuth2AuthorizationServerId { get; set; } + /// operations scope. + string OAuth2Scope { get; set; } + /// How to send token to the server. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + string OpenidProviderId { get; set; } + /// Protocols over which API is made available. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get; set; } + /// Subscription key header name. + string SubscriptionKeyParameterNameHeader { get; set; } + /// Subscription key query string parameter name. + string SubscriptionKeyParameterNameQuery { get; set; } + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + bool? SubscriptionRequired { get; set; } + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + string TermsOfServiceUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiEntityBaseContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiEntityBaseContract.json.cs new file mode 100644 index 000000000000..e20433a93a99 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiEntityBaseContract.json.cs @@ -0,0 +1,139 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API base contract details. + public partial class ApiEntityBaseContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiEntityBaseContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authenticationSetting = If( json?.PropertyT("authenticationSettings"), out var __jsonAuthenticationSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthenticationSettingsContract.FromJson(__jsonAuthenticationSettings) : AuthenticationSetting;} + {_subscriptionKeyParameterName = If( json?.PropertyT("subscriptionKeyParameterNames"), out var __jsonSubscriptionKeyParameterNames) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionKeyParameterNamesContract.FromJson(__jsonSubscriptionKeyParameterNames) : SubscriptionKeyParameterName;} + {_contact = If( json?.PropertyT("contact"), out var __jsonContact) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContactInformation.FromJson(__jsonContact) : Contact;} + {_license = If( json?.PropertyT("license"), out var __jsonLicense) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiLicenseInformation.FromJson(__jsonLicense) : License;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_apiType = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)ApiType;} + {_apiRevision = If( json?.PropertyT("apiRevision"), out var __jsonApiRevision) ? (string)__jsonApiRevision : (string)ApiRevision;} + {_apiVersion = If( json?.PropertyT("apiVersion"), out var __jsonApiVersion) ? (string)__jsonApiVersion : (string)ApiVersion;} + {_isCurrent = If( json?.PropertyT("isCurrent"), out var __jsonIsCurrent) ? (bool?)__jsonIsCurrent : IsCurrent;} + {_isOnline = If( json?.PropertyT("isOnline"), out var __jsonIsOnline) ? (bool?)__jsonIsOnline : IsOnline;} + {_apiRevisionDescription = If( json?.PropertyT("apiRevisionDescription"), out var __jsonApiRevisionDescription) ? (string)__jsonApiRevisionDescription : (string)ApiRevisionDescription;} + {_apiVersionDescription = If( json?.PropertyT("apiVersionDescription"), out var __jsonApiVersionDescription) ? (string)__jsonApiVersionDescription : (string)ApiVersionDescription;} + {_apiVersionSetId = If( json?.PropertyT("apiVersionSetId"), out var __jsonApiVersionSetId) ? (string)__jsonApiVersionSetId : (string)ApiVersionSetId;} + {_subscriptionRequired = If( json?.PropertyT("subscriptionRequired"), out var __jsonSubscriptionRequired) ? (bool?)__jsonSubscriptionRequired : SubscriptionRequired;} + {_termsOfServiceUrl = If( json?.PropertyT("termsOfServiceUrl"), out var __jsonTermsOfServiceUrl) ? (string)__jsonTermsOfServiceUrl : (string)TermsOfServiceUrl;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiEntityBaseContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._authenticationSetting ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._authenticationSetting.ToJson(null,serializationMode) : null, "authenticationSettings" ,container.Add ); + AddIf( null != this._subscriptionKeyParameterName ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._subscriptionKeyParameterName.ToJson(null,serializationMode) : null, "subscriptionKeyParameterNames" ,container.Add ); + AddIf( null != this._contact ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._contact.ToJson(null,serializationMode) : null, "contact" ,container.Add ); + AddIf( null != this._license ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._license.ToJson(null,serializationMode) : null, "license" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._apiType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiType.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._apiRevision)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiRevision.ToString()) : null, "apiRevision" ,container.Add ); + AddIf( null != (((object)this._apiVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiVersion.ToString()) : null, "apiVersion" ,container.Add ); + AddIf( null != this._isCurrent ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isCurrent) : null, "isCurrent" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isOnline ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isOnline) : null, "isOnline" ,container.Add ); + } + AddIf( null != (((object)this._apiRevisionDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiRevisionDescription.ToString()) : null, "apiRevisionDescription" ,container.Add ); + AddIf( null != (((object)this._apiVersionDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiVersionDescription.ToString()) : null, "apiVersionDescription" ,container.Add ); + AddIf( null != (((object)this._apiVersionSetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiVersionSetId.ToString()) : null, "apiVersionSetId" ,container.Add ); + AddIf( null != this._subscriptionRequired ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._subscriptionRequired) : null, "subscriptionRequired" ,container.Add ); + AddIf( null != (((object)this._termsOfServiceUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._termsOfServiceUrl.ToString()) : null, "termsOfServiceUrl" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResult.cs new file mode 100644 index 000000000000..8fd13faa75e9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResult.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Export result. + public partial class ApiExportResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat? _exportResultFormat; + + /// + /// Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat? ExportResultFormat { get => this._exportResultFormat; set => this._exportResultFormat = value; } + + /// Backing field for property. + private string _id; + + /// ResourceId of the API which was exported. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValue Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultInternal.Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiExportResultValue()); set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValue _value; + + /// The object defining the schema of the exported API Detail + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValue Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiExportResultValue()); set => this._value = value; } + + /// + /// Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ValueLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValueInternal)Value).Link; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValueInternal)Value).Link = value ?? null; } + + /// Creates an new instance. + public ApiExportResult() + { + + } + } + /// API Export result. + public partial interface IApiExportResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat? ExportResultFormat { get; set; } + /// ResourceId of the API which was exported. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ResourceId of the API which was exported.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// + /// Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes.", + SerializedName = @"link", + PossibleTypes = new [] { typeof(string) })] + string ValueLink { get; set; } + + } + /// API Export result. + internal partial interface IApiExportResultInternal + + { + /// + /// Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat? ExportResultFormat { get; set; } + /// ResourceId of the API which was exported. + string Id { get; set; } + /// The object defining the schema of the exported API Detail + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValue Value { get; set; } + /// + /// Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. + /// + string ValueLink { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResult.json.cs new file mode 100644 index 000000000000..49514d75d42b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResult.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Export result. + public partial class ApiExportResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiExportResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiExportResultValue.FromJson(__jsonValue) : Value;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_exportResultFormat = If( json?.PropertyT("format"), out var __jsonFormat) ? (string)__jsonFormat : (string)ExportResultFormat;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiExportResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._value.ToJson(null,serializationMode) : null, "value" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._exportResultFormat)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._exportResultFormat.ToString()) : null, "format" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResultValue.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResultValue.cs new file mode 100644 index 000000000000..878b9f78b54c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResultValue.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The object defining the schema of the exported API Detail + public partial class ApiExportResultValue : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValue, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValueInternal + { + + /// Backing field for property. + private string _link; + + /// + /// Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Link { get => this._link; set => this._link = value; } + + /// Creates an new instance. + public ApiExportResultValue() + { + + } + } + /// The object defining the schema of the exported API Detail + public partial interface IApiExportResultValue : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes.", + SerializedName = @"link", + PossibleTypes = new [] { typeof(string) })] + string Link { get; set; } + + } + /// The object defining the schema of the exported API Detail + internal partial interface IApiExportResultValueInternal + + { + /// + /// Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. + /// + string Link { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResultValue.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResultValue.json.cs new file mode 100644 index 000000000000..f7a3bdb23075 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiExportResultValue.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The object defining the schema of the exported API Detail + public partial class ApiExportResultValue + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiExportResultValue(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_link = If( json?.PropertyT("link"), out var __jsonLink) ? (string)__jsonLink : (string)Link;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiExportResultValue FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiExportResultValue(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._link)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._link.ToString()) : null, "link" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiLicenseInformation.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiLicenseInformation.cs new file mode 100644 index 000000000000..b1b9271719ca --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiLicenseInformation.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API license information + public partial class ApiLicenseInformation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformationInternal + { + + /// Backing field for property. + private string _name; + + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _url; + + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Url { get => this._url; set => this._url = value; } + + /// Creates an new instance. + public ApiLicenseInformation() + { + + } + } + /// API license information + public partial interface IApiLicenseInformation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The license name used for the API", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A URL to the license used for the API. MUST be in the format of a URL", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + + } + /// API license information + internal partial interface IApiLicenseInformationInternal + + { + /// The license name used for the API + string Name { get; set; } + /// A URL to the license used for the API. MUST be in the format of a URL + string Url { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiLicenseInformation.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiLicenseInformation.json.cs new file mode 100644 index 000000000000..979604fda957 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiLicenseInformation.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API license information + public partial class ApiLicenseInformation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiLicenseInformation(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)Url;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiLicenseInformation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._url)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._url.ToString()) : null, "url" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceApplyNetworkConfigurationParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceApplyNetworkConfigurationParameters.cs new file mode 100644 index 000000000000..de31d8ed41ce --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceApplyNetworkConfigurationParameters.cs @@ -0,0 +1,62 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameter supplied to the Apply Network configuration operation. + public partial class ApiManagementServiceApplyNetworkConfigurationParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceApplyNetworkConfigurationParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceApplyNetworkConfigurationParametersInternal + { + + /// Backing field for property. + private string _location; + + /// + /// Location of the Api Management service to update for a multi-region service. For a service deployed in a single region, + /// this parameter is not required. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ApiManagementServiceApplyNetworkConfigurationParameters() + { + + } + } + /// Parameter supplied to the Apply Network configuration operation. + public partial interface IApiManagementServiceApplyNetworkConfigurationParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Location of the Api Management service to update for a multi-region service. For a service deployed in a single region, + /// this parameter is not required. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location of the Api Management service to update for a multi-region service. For a service deployed in a single region, this parameter is not required.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + /// Parameter supplied to the Apply Network configuration operation. + internal partial interface IApiManagementServiceApplyNetworkConfigurationParametersInternal + + { + /// + /// Location of the Api Management service to update for a multi-region service. For a service deployed in a single region, + /// this parameter is not required. + /// + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceApplyNetworkConfigurationParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceApplyNetworkConfigurationParameters.json.cs new file mode 100644 index 000000000000..cdc03e6cd8a4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceApplyNetworkConfigurationParameters.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameter supplied to the Apply Network configuration operation. + public partial class ApiManagementServiceApplyNetworkConfigurationParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceApplyNetworkConfigurationParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceApplyNetworkConfigurationParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceApplyNetworkConfigurationParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceApplyNetworkConfigurationParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceApplyNetworkConfigurationParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBackupRestoreParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBackupRestoreParameters.cs new file mode 100644 index 000000000000..07d5fb346d56 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBackupRestoreParameters.cs @@ -0,0 +1,152 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Parameters supplied to the Backup/Restore of an API Management service operation. + /// + public partial class ApiManagementServiceBackupRestoreParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParametersInternal + { + + /// Backing field for property. + private string _accessKey; + + /// + /// Storage account access key. Required only if `accessType` is set to `AccessKey`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AccessKey { get => this._accessKey; set => this._accessKey = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType? _accessType; + + /// The type of access to be used for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType? AccessType { get => this._accessType; set => this._accessType = value; } + + /// Backing field for property. + private string _backupName; + + /// The name of the backup file to create/retrieve. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string BackupName { get => this._backupName; set => this._backupName = value; } + + /// Backing field for property. + private string _clientId; + + /// + /// The Client ID of user assigned managed identity. Required only if `accessType` is set to `UserAssignedManagedIdentity`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// Backing field for property. + private string _containerName; + + /// The name of the blob container (used to place/retrieve the backup). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private string _storageAccount; + + /// The name of the Azure storage account (used to place/retrieve the backup). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string StorageAccount { get => this._storageAccount; set => this._storageAccount = value; } + + /// + /// Creates an new instance. + /// + public ApiManagementServiceBackupRestoreParameters() + { + + } + } + /// Parameters supplied to the Backup/Restore of an API Management service operation. + public partial interface IApiManagementServiceBackupRestoreParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Storage account access key. Required only if `accessType` is set to `AccessKey`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage account access key. Required only if `accessType` is set to `AccessKey`.", + SerializedName = @"accessKey", + PossibleTypes = new [] { typeof(string) })] + string AccessKey { get; set; } + /// The type of access to be used for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of access to be used for the storage account.", + SerializedName = @"accessType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType? AccessType { get; set; } + /// The name of the backup file to create/retrieve. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the backup file to create/retrieve.", + SerializedName = @"backupName", + PossibleTypes = new [] { typeof(string) })] + string BackupName { get; set; } + /// + /// The Client ID of user assigned managed identity. Required only if `accessType` is set to `UserAssignedManagedIdentity`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Client ID of user assigned managed identity. Required only if `accessType` is set to `UserAssignedManagedIdentity`.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// The name of the blob container (used to place/retrieve the backup). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container (used to place/retrieve the backup).", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// The name of the Azure storage account (used to place/retrieve the backup). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure storage account (used to place/retrieve the backup).", + SerializedName = @"storageAccount", + PossibleTypes = new [] { typeof(string) })] + string StorageAccount { get; set; } + + } + /// Parameters supplied to the Backup/Restore of an API Management service operation. + internal partial interface IApiManagementServiceBackupRestoreParametersInternal + + { + /// + /// Storage account access key. Required only if `accessType` is set to `AccessKey`. + /// + string AccessKey { get; set; } + /// The type of access to be used for the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType? AccessType { get; set; } + /// The name of the backup file to create/retrieve. + string BackupName { get; set; } + /// + /// The Client ID of user assigned managed identity. Required only if `accessType` is set to `UserAssignedManagedIdentity`. + /// + string ClientId { get; set; } + /// The name of the blob container (used to place/retrieve the backup). + string ContainerName { get; set; } + /// The name of the Azure storage account (used to place/retrieve the backup). + string StorageAccount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBackupRestoreParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBackupRestoreParameters.json.cs new file mode 100644 index 000000000000..924839c090af --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBackupRestoreParameters.json.cs @@ -0,0 +1,122 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Parameters supplied to the Backup/Restore of an API Management service operation. + /// + public partial class ApiManagementServiceBackupRestoreParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceBackupRestoreParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_storageAccount = If( json?.PropertyT("storageAccount"), out var __jsonStorageAccount) ? (string)__jsonStorageAccount : (string)StorageAccount;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_backupName = If( json?.PropertyT("backupName"), out var __jsonBackupName) ? (string)__jsonBackupName : (string)BackupName;} + {_accessType = If( json?.PropertyT("accessType"), out var __jsonAccessType) ? (string)__jsonAccessType : (string)AccessType;} + {_accessKey = If( json?.PropertyT("accessKey"), out var __jsonAccessKey) ? (string)__jsonAccessKey : (string)AccessKey;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBackupRestoreParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceBackupRestoreParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._storageAccount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._storageAccount.ToString()) : null, "storageAccount" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._backupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._backupName.ToString()) : null, "backupName" ,container.Add ); + AddIf( null != (((object)this._accessType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._accessType.ToString()) : null, "accessType" ,container.Add ); + AddIf( null != (((object)this._accessKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._accessKey.ToString()) : null, "accessKey" ,container.Add ); + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBaseProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBaseProperties.cs new file mode 100644 index 000000000000..ca4ba8404570 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBaseProperties.cs @@ -0,0 +1,856 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Base Properties of an API Management service resource description. + public partial class ApiManagementServiceBaseProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBaseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] _additionalLocation; + + /// Additional datacenter locations of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get => this._additionalLocation; set => this._additionalLocation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint _apiVersionConstraint; + + /// Control Plane Apis version constraint for the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint ApiVersionConstraint { get => (this._apiVersionConstraint = this._apiVersionConstraint ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionConstraint()); set => this._apiVersionConstraint = value; } + + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionConstraintMinApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraintInternal)ApiVersionConstraint).MinApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraintInternal)ApiVersionConstraint).MinApiVersion = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] _certificate; + + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get => this._certificate; set => this._certificate = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi _configurationApi; + + /// Configuration API configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi ConfigurationApi { get => (this._configurationApi = this._configurationApi ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConfigurationApi()); set => this._configurationApi = value; } + + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApiInternal)ConfigurationApi).LegacyApi; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApiInternal)ConfigurationApi).LegacyApi = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState)""); } + + /// Backing field for property. + private global::System.DateTime? _createdAtUtc; + + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedAtUtc { get => this._createdAtUtc; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties _customProperty; + + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get => (this._customProperty = this._customProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceBasePropertiesCustomProperties()); set => this._customProperty = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? _developerPortalStatus; + + /// Status of developer portal in this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get => this._developerPortalStatus; set => this._developerPortalStatus = value; } + + /// Backing field for property. + private string _developerPortalUrl; + + /// DEveloper Portal endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DeveloperPortalUrl { get => this._developerPortalUrl; } + + /// Backing field for property. + private bool? _disableGateway; + + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? DisableGateway { get => this._disableGateway; set => this._disableGateway = value; } + + /// Backing field for property. + private bool? _enableClientCertificate; + + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? EnableClientCertificate { get => this._enableClientCertificate; set => this._enableClientCertificate = value; } + + /// Backing field for property. + private string _gatewayRegionalUrl; + + /// Gateway URL of the API Management service in the Default Region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string GatewayRegionalUrl { get => this._gatewayRegionalUrl; } + + /// Backing field for property. + private string _gatewayUrl; + + /// Gateway URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string GatewayUrl { get => this._gatewayUrl; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] _hostnameConfiguration; + + /// Custom hostname configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get => this._hostnameConfiguration; set => this._hostnameConfiguration = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? _legacyPortalStatus; + + /// Status of legacy portal in the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get => this._legacyPortalStatus; set => this._legacyPortalStatus = value; } + + /// Backing field for property. + private string _managementApiUrl; + + /// Management API endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ManagementApiUrl { get => this._managementApiUrl; } + + /// Internal Acessors for ApiVersionConstraint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ApiVersionConstraint { get => (this._apiVersionConstraint = this._apiVersionConstraint ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionConstraint()); set { {_apiVersionConstraint = value;} } } + + /// Internal Acessors for ConfigurationApi + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ConfigurationApi { get => (this._configurationApi = this._configurationApi ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConfigurationApi()); set { {_configurationApi = value;} } } + + /// Internal Acessors for CreatedAtUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.CreatedAtUtc { get => this._createdAtUtc; set { {_createdAtUtc = value;} } } + + /// Internal Acessors for DeveloperPortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.DeveloperPortalUrl { get => this._developerPortalUrl; set { {_developerPortalUrl = value;} } } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.GatewayRegionalUrl { get => this._gatewayRegionalUrl; set { {_gatewayRegionalUrl = value;} } } + + /// Internal Acessors for GatewayUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.GatewayUrl { get => this._gatewayUrl; set { {_gatewayUrl = value;} } } + + /// Internal Acessors for ManagementApiUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ManagementApiUrl { get => this._managementApiUrl; set { {_managementApiUrl = value;} } } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.OutboundPublicIPAddress { get => this._outboundPublicIPAddress; set { {_outboundPublicIPAddress = value;} } } + + /// Internal Acessors for PlatformVersion + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PlatformVersion { get => this._platformVersion; set { {_platformVersion = value;} } } + + /// Internal Acessors for PortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PortalUrl { get => this._portalUrl; set { {_portalUrl = value;} } } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PrivateIPAddress { get => this._privateIPAddress; set { {_privateIPAddress = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PublicIPAddress { get => this._publicIPAddress; set { {_publicIPAddress = value;} } } + + /// Internal Acessors for ScmUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ScmUrl { get => this._scmUrl; set { {_scmUrl = value;} } } + + /// Internal Acessors for TargetProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.TargetProvisioningState { get => this._targetProvisioningState; set { {_targetProvisioningState = value;} } } + + /// Internal Acessors for VirtualNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfiguration { get => (this._virtualNetworkConfiguration = this._virtualNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.VirtualNetworkConfiguration()); set { {_virtualNetworkConfiguration = value;} } } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Subnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Subnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Vnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Vnetid = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? _natGatewayState; + + /// Property can be used to enable NAT Gateway for this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get => this._natGatewayState; set => this._natGatewayState = value; } + + /// Backing field for property. + private string _notificationSenderEmail; + + /// Email address from which the notification will be sent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NotificationSenderEmail { get => this._notificationSenderEmail; set => this._notificationSenderEmail = value; } + + /// Backing field for property. + private string[] _outboundPublicIPAddress; + + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] OutboundPublicIPAddress { get => this._outboundPublicIPAddress; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? _platformVersion; + + /// Compute Platform Version running the service in this location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get => this._platformVersion; } + + /// Backing field for property. + private string _portalUrl; + + /// Publisher portal endpoint Url of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PortalUrl { get => this._portalUrl; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] _privateEndpointConnection; + + /// List of Private Endpoint Connections of this service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get => this._privateEndpointConnection; set => this._privateEndpointConnection = value; } + + /// Backing field for property. + private string[] _privateIPAddress; + + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] PrivateIPAddress { get => this._privateIPAddress; } + + /// Backing field for property. + private string _provisioningState; + + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string[] _publicIPAddress; + + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] PublicIPAddress { get => this._publicIPAddress; } + + /// Backing field for property. + private string _publicIPAddressId; + + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PublicIPAddressId { get => this._publicIPAddressId; set => this._publicIPAddressId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// Backing field for property. + private bool? _restore; + + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Restore { get => this._restore; set => this._restore = value; } + + /// Backing field for property. + private string _scmUrl; + + /// SCM endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ScmUrl { get => this._scmUrl; } + + /// Backing field for property. + private string _targetProvisioningState; + + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TargetProvisioningState { get => this._targetProvisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration _virtualNetworkConfiguration; + + /// Virtual network configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get => (this._virtualNetworkConfiguration = this._virtualNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.VirtualNetworkConfiguration()); set => this._virtualNetworkConfiguration = value; } + + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationSubnetResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).SubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).SubnetResourceId = value ?? null; } + + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Subnetname; } + + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal)VirtualNetworkConfiguration).Vnetid; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? _virtualNetworkType; + + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get => this._virtualNetworkType; set => this._virtualNetworkType = value; } + + /// Creates an new instance. + public ApiManagementServiceBaseProperties() + { + + } + } + /// Base Properties of an API Management service resource description. + public partial interface IApiManagementServiceBaseProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Additional datacenter locations of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional datacenter locations of the API Management service.", + SerializedName = @"additionalLocations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get; set; } + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Limit control plane API calls to API Management service with version equal to or newer than this value.", + SerializedName = @"minApiVersion", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionConstraintMinApiVersion { get; set; } + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.", + SerializedName = @"certificates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get; set; } + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted gateways. Default value is 'Enabled'", + SerializedName = @"legacyApi", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get; set; } + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.", + SerializedName = @"createdAtUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedAtUtc { get; } + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + SerializedName = @"customProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get; set; } + /// Status of developer portal in this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of developer portal in this API Management service.", + SerializedName = @"developerPortalStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get; set; } + /// DEveloper Portal endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"DEveloper Portal endpoint URL of the API Management service.", + SerializedName = @"developerPortalUrl", + PossibleTypes = new [] { typeof(string) })] + string DeveloperPortalUrl { get; } + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.", + SerializedName = @"disableGateway", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableGateway { get; set; } + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway.", + SerializedName = @"enableClientCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableClientCertificate { get; set; } + /// Gateway URL of the API Management service in the Default Region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gateway URL of the API Management service in the Default Region.", + SerializedName = @"gatewayRegionalUrl", + PossibleTypes = new [] { typeof(string) })] + string GatewayRegionalUrl { get; } + /// Gateway URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gateway URL of the API Management service.", + SerializedName = @"gatewayUrl", + PossibleTypes = new [] { typeof(string) })] + string GatewayUrl { get; } + /// Custom hostname configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Custom hostname configuration of the API Management service.", + SerializedName = @"hostnameConfigurations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get; set; } + /// Status of legacy portal in the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of legacy portal in the API Management service.", + SerializedName = @"legacyPortalStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get; set; } + /// Management API endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Management API endpoint URL of the API Management service.", + SerializedName = @"managementApiUrl", + PossibleTypes = new [] { typeof(string) })] + string ManagementApiUrl { get; } + /// Property can be used to enable NAT Gateway for this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property can be used to enable NAT Gateway for this API Management service.", + SerializedName = @"natGatewayState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get; set; } + /// Email address from which the notification will be sent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email address from which the notification will be sent.", + SerializedName = @"notificationSenderEmail", + PossibleTypes = new [] { typeof(string) })] + string NotificationSenderEmail { get; set; } + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on stv2 platform.", + SerializedName = @"outboundPublicIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] OutboundPublicIPAddress { get; } + /// Compute Platform Version running the service in this location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Compute Platform Version running the service in this location.", + SerializedName = @"platformVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get; } + /// Publisher portal endpoint Url of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Publisher portal endpoint Url of the API Management service.", + SerializedName = @"portalUrl", + PossibleTypes = new [] { typeof(string) })] + string PortalUrl { get; } + /// List of Private Endpoint Connections of this service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Private Endpoint Connections of this service.", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get; set; } + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU.", + SerializedName = @"privateIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] PrivateIPAddress { get; } + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU.", + SerializedName = @"publicIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] PublicIPAddress { get; } + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network.", + SerializedName = @"publicIpAddressId", + PossibleTypes = new [] { typeof(string) })] + string PublicIPAddressId { get; set; } + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored.", + SerializedName = @"restore", + PossibleTypes = new [] { typeof(bool) })] + bool? Restore { get; set; } + /// SCM endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"SCM endpoint URL of the API Management service.", + SerializedName = @"scmUrl", + PossibleTypes = new [] { typeof(string) })] + string ScmUrl { get; } + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state of the API Management service, which is targeted by the long running operation started on the service.", + SerializedName = @"targetProvisioningState", + PossibleTypes = new [] { typeof(string) })] + string TargetProvisioningState { get; } + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full resource ID of a subnet in a virtual network to deploy the API Management service in.", + SerializedName = @"subnetResourceId", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationSubnetResourceId { get; set; } + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the subnet.", + SerializedName = @"subnetname", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationSubnetname { get; } + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The virtual network ID. This is typically a GUID. Expect a null GUID by default.", + SerializedName = @"vnetid", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationVnetid { get; } + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only.", + SerializedName = @"virtualNetworkType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get; set; } + + } + /// Base Properties of an API Management service resource description. + internal partial interface IApiManagementServiceBasePropertiesInternal + + { + /// Additional datacenter locations of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get; set; } + /// Control Plane Apis version constraint for the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint ApiVersionConstraint { get; set; } + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + string ApiVersionConstraintMinApiVersion { get; set; } + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get; set; } + /// Configuration API configuration of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi ConfigurationApi { get; set; } + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get; set; } + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? CreatedAtUtc { get; set; } + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get; set; } + /// Status of developer portal in this API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get; set; } + /// DEveloper Portal endpoint URL of the API Management service. + string DeveloperPortalUrl { get; set; } + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + bool? DisableGateway { get; set; } + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + bool? EnableClientCertificate { get; set; } + /// Gateway URL of the API Management service in the Default Region. + string GatewayRegionalUrl { get; set; } + /// Gateway URL of the API Management service. + string GatewayUrl { get; set; } + /// Custom hostname configuration of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get; set; } + /// Status of legacy portal in the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get; set; } + /// Management API endpoint URL of the API Management service. + string ManagementApiUrl { get; set; } + /// Property can be used to enable NAT Gateway for this API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get; set; } + /// Email address from which the notification will be sent. + string NotificationSenderEmail { get; set; } + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + string[] OutboundPublicIPAddress { get; set; } + /// Compute Platform Version running the service in this location. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get; set; } + /// Publisher portal endpoint Url of the API Management service. + string PortalUrl { get; set; } + /// List of Private Endpoint Connections of this service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get; set; } + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + string[] PrivateIPAddress { get; set; } + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + string ProvisioningState { get; set; } + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + string[] PublicIPAddress { get; set; } + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + string PublicIPAddressId { get; set; } + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + bool? Restore { get; set; } + /// SCM endpoint URL of the API Management service. + string ScmUrl { get; set; } + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + string TargetProvisioningState { get; set; } + /// Virtual network configuration of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get; set; } + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + string VirtualNetworkConfigurationSubnetResourceId { get; set; } + /// The name of the subnet. + string VirtualNetworkConfigurationSubnetname { get; set; } + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + string VirtualNetworkConfigurationVnetid { get; set; } + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBaseProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBaseProperties.json.cs new file mode 100644 index 000000000000..071f735ac695 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBaseProperties.json.cs @@ -0,0 +1,264 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Base Properties of an API Management service resource description. + public partial class ApiManagementServiceBaseProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceBaseProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_configurationApi = If( json?.PropertyT("configurationApi"), out var __jsonConfigurationApi) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConfigurationApi.FromJson(__jsonConfigurationApi) : ConfigurationApi;} + {_virtualNetworkConfiguration = If( json?.PropertyT("virtualNetworkConfiguration"), out var __jsonVirtualNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.VirtualNetworkConfiguration.FromJson(__jsonVirtualNetworkConfiguration) : VirtualNetworkConfiguration;} + {_apiVersionConstraint = If( json?.PropertyT("apiVersionConstraint"), out var __jsonApiVersionConstraint) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionConstraint.FromJson(__jsonApiVersionConstraint) : ApiVersionConstraint;} + {_notificationSenderEmail = If( json?.PropertyT("notificationSenderEmail"), out var __jsonNotificationSenderEmail) ? (string)__jsonNotificationSenderEmail : (string)NotificationSenderEmail;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_targetProvisioningState = If( json?.PropertyT("targetProvisioningState"), out var __jsonTargetProvisioningState) ? (string)__jsonTargetProvisioningState : (string)TargetProvisioningState;} + {_createdAtUtc = If( json?.PropertyT("createdAtUtc"), out var __jsonCreatedAtUtc) ? global::System.DateTime.TryParse((string)__jsonCreatedAtUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtUtcValue) ? __jsonCreatedAtUtcValue : CreatedAtUtc : CreatedAtUtc;} + {_gatewayUrl = If( json?.PropertyT("gatewayUrl"), out var __jsonGatewayUrl) ? (string)__jsonGatewayUrl : (string)GatewayUrl;} + {_gatewayRegionalUrl = If( json?.PropertyT("gatewayRegionalUrl"), out var __jsonGatewayRegionalUrl) ? (string)__jsonGatewayRegionalUrl : (string)GatewayRegionalUrl;} + {_portalUrl = If( json?.PropertyT("portalUrl"), out var __jsonPortalUrl) ? (string)__jsonPortalUrl : (string)PortalUrl;} + {_managementApiUrl = If( json?.PropertyT("managementApiUrl"), out var __jsonManagementApiUrl) ? (string)__jsonManagementApiUrl : (string)ManagementApiUrl;} + {_scmUrl = If( json?.PropertyT("scmUrl"), out var __jsonScmUrl) ? (string)__jsonScmUrl : (string)ScmUrl;} + {_developerPortalUrl = If( json?.PropertyT("developerPortalUrl"), out var __jsonDeveloperPortalUrl) ? (string)__jsonDeveloperPortalUrl : (string)DeveloperPortalUrl;} + {_hostnameConfiguration = If( json?.PropertyT("hostnameConfigurations"), out var __jsonHostnameConfigurations) ? If( __jsonHostnameConfigurations as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.HostnameConfiguration.FromJson(__u) )) ))() : null : HostnameConfiguration;} + {_publicIPAddress = If( json?.PropertyT("publicIPAddresses"), out var __jsonPublicIPAddresses) ? If( __jsonPublicIPAddresses as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : PublicIPAddress;} + {_privateIPAddress = If( json?.PropertyT("privateIPAddresses"), out var __jsonPrivateIPAddresses) ? If( __jsonPrivateIPAddresses as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : PrivateIPAddress;} + {_publicIPAddressId = If( json?.PropertyT("publicIpAddressId"), out var __jsonPublicIPAddressId) ? (string)__jsonPublicIPAddressId : (string)PublicIPAddressId;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_additionalLocation = If( json?.PropertyT("additionalLocations"), out var __jsonAdditionalLocations) ? If( __jsonAdditionalLocations as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AdditionalLocation.FromJson(__f) )) ))() : null : AdditionalLocation;} + {_customProperty = If( json?.PropertyT("customProperties"), out var __jsonCustomProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceBasePropertiesCustomProperties.FromJson(__jsonCustomProperties) : CustomProperty;} + {_certificate = If( json?.PropertyT("certificates"), out var __jsonCertificates) ? If( __jsonCertificates as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateConfiguration.FromJson(__a) )) ))() : null : Certificate;} + {_enableClientCertificate = If( json?.PropertyT("enableClientCertificate"), out var __jsonEnableClientCertificate) ? (bool?)__jsonEnableClientCertificate : EnableClientCertificate;} + {_natGatewayState = If( json?.PropertyT("natGatewayState"), out var __jsonNatGatewayState) ? (string)__jsonNatGatewayState : (string)NatGatewayState;} + {_outboundPublicIPAddress = If( json?.PropertyT("outboundPublicIPAddresses"), out var __jsonOutboundPublicIPAddresses) ? If( __jsonOutboundPublicIPAddresses as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(string) (___v is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString ___u ? (string)(___u.ToString()) : null)) ))() : null : OutboundPublicIPAddress;} + {_disableGateway = If( json?.PropertyT("disableGateway"), out var __jsonDisableGateway) ? (bool?)__jsonDisableGateway : DisableGateway;} + {_virtualNetworkType = If( json?.PropertyT("virtualNetworkType"), out var __jsonVirtualNetworkType) ? (string)__jsonVirtualNetworkType : (string)VirtualNetworkType;} + {_restore = If( json?.PropertyT("restore"), out var __jsonRestore) ? (bool?)__jsonRestore : Restore;} + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RemotePrivateEndpointConnectionWrapper.FromJson(___q) )) ))() : null : PrivateEndpointConnection;} + {_platformVersion = If( json?.PropertyT("platformVersion"), out var __jsonPlatformVersion) ? (string)__jsonPlatformVersion : (string)PlatformVersion;} + {_legacyPortalStatus = If( json?.PropertyT("legacyPortalStatus"), out var __jsonLegacyPortalStatus) ? (string)__jsonLegacyPortalStatus : (string)LegacyPortalStatus;} + {_developerPortalStatus = If( json?.PropertyT("developerPortalStatus"), out var __jsonDeveloperPortalStatus) ? (string)__jsonDeveloperPortalStatus : (string)DeveloperPortalStatus;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBaseProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBaseProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBaseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceBaseProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._configurationApi ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._configurationApi.ToJson(null,serializationMode) : null, "configurationApi" ,container.Add ); + AddIf( null != this._virtualNetworkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._virtualNetworkConfiguration.ToJson(null,serializationMode) : null, "virtualNetworkConfiguration" ,container.Add ); + AddIf( null != this._apiVersionConstraint ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._apiVersionConstraint.ToJson(null,serializationMode) : null, "apiVersionConstraint" ,container.Add ); + AddIf( null != (((object)this._notificationSenderEmail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._notificationSenderEmail.ToString()) : null, "notificationSenderEmail" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._targetProvisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._targetProvisioningState.ToString()) : null, "targetProvisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._createdAtUtc ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._createdAtUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAtUtc" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._gatewayUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._gatewayUrl.ToString()) : null, "gatewayUrl" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._gatewayRegionalUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._gatewayRegionalUrl.ToString()) : null, "gatewayRegionalUrl" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._portalUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._portalUrl.ToString()) : null, "portalUrl" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._managementApiUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._managementApiUrl.ToString()) : null, "managementApiUrl" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._scmUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._scmUrl.ToString()) : null, "scmUrl" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._developerPortalUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._developerPortalUrl.ToString()) : null, "developerPortalUrl" ,container.Add ); + } + if (null != this._hostnameConfiguration) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._hostnameConfiguration ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("hostnameConfigurations",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._publicIPAddress) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._publicIPAddress ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("publicIPAddresses",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._privateIPAddress) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __n in this._privateIPAddress ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("privateIPAddresses",__m); + } + } + AddIf( null != (((object)this._publicIPAddressId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._publicIPAddressId.ToString()) : null, "publicIpAddressId" ,container.Add ); + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + if (null != this._additionalLocation) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __i in this._additionalLocation ) + { + AddIf(__i?.ToJson(null, serializationMode) ,__h.Add); + } + container.Add("additionalLocations",__h); + } + AddIf( null != this._customProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._customProperty.ToJson(null,serializationMode) : null, "customProperties" ,container.Add ); + if (null != this._certificate) + { + var __c = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __d in this._certificate ) + { + AddIf(__d?.ToJson(null, serializationMode) ,__c.Add); + } + container.Add("certificates",__c); + } + AddIf( null != this._enableClientCertificate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enableClientCertificate) : null, "enableClientCertificate" ,container.Add ); + AddIf( null != (((object)this._natGatewayState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._natGatewayState.ToString()) : null, "natGatewayState" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._outboundPublicIPAddress) + { + var ___x = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var ___y in this._outboundPublicIPAddress ) + { + AddIf(null != (((object)___y)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(___y.ToString()) : null ,___x.Add); + } + container.Add("outboundPublicIPAddresses",___x); + } + } + AddIf( null != this._disableGateway ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._disableGateway) : null, "disableGateway" ,container.Add ); + AddIf( null != (((object)this._virtualNetworkType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._virtualNetworkType.ToString()) : null, "virtualNetworkType" ,container.Add ); + AddIf( null != this._restore ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._restore) : null, "restore" ,container.Add ); + if (null != this._privateEndpointConnection) + { + var ___s = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var ___t in this._privateEndpointConnection ) + { + AddIf(___t?.ToJson(null, serializationMode) ,___s.Add); + } + container.Add("privateEndpointConnections",___s); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._platformVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._platformVersion.ToString()) : null, "platformVersion" ,container.Add ); + } + AddIf( null != (((object)this._legacyPortalStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._legacyPortalStatus.ToString()) : null, "legacyPortalStatus" ,container.Add ); + AddIf( null != (((object)this._developerPortalStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._developerPortalStatus.ToString()) : null, "developerPortalStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBasePropertiesCustomProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBasePropertiesCustomProperties.cs new file mode 100644 index 000000000000..4a7702d94bf4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBasePropertiesCustomProperties.cs @@ -0,0 +1,81 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ public partial class ApiManagementServiceBasePropertiesCustomProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomPropertiesInternal + { + + /// + /// Creates an new instance. + /// + public ApiManagementServiceBasePropertiesCustomProperties() + { + + } + } + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + public partial interface IApiManagementServiceBasePropertiesCustomProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + internal partial interface IApiManagementServiceBasePropertiesCustomPropertiesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBasePropertiesCustomProperties.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBasePropertiesCustomProperties.dictionary.cs new file mode 100644 index 000000000000..0bbfe585e86e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBasePropertiesCustomProperties.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceBasePropertiesCustomProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceBasePropertiesCustomProperties source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBasePropertiesCustomProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBasePropertiesCustomProperties.json.cs new file mode 100644 index 000000000000..e27b6291f635 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceBasePropertiesCustomProperties.json.cs @@ -0,0 +1,128 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ public partial class ApiManagementServiceBasePropertiesCustomProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ApiManagementServiceBasePropertiesCustomProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceBasePropertiesCustomProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceCheckNameAvailabilityParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceCheckNameAvailabilityParameters.cs new file mode 100644 index 000000000000..2ef45519c404 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceCheckNameAvailabilityParameters.cs @@ -0,0 +1,53 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the CheckNameAvailability operation. + public partial class ApiManagementServiceCheckNameAvailabilityParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceCheckNameAvailabilityParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceCheckNameAvailabilityParametersInternal + { + + /// Backing field for property. + private string _name; + + /// The name to check for availability. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// Creates an new instance. + /// + public ApiManagementServiceCheckNameAvailabilityParameters() + { + + } + } + /// Parameters supplied to the CheckNameAvailability operation. + public partial interface IApiManagementServiceCheckNameAvailabilityParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The name to check for availability. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name to check for availability.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Parameters supplied to the CheckNameAvailability operation. + internal partial interface IApiManagementServiceCheckNameAvailabilityParametersInternal + + { + /// The name to check for availability. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceCheckNameAvailabilityParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceCheckNameAvailabilityParameters.json.cs new file mode 100644 index 000000000000..1b83da58e1ce --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceCheckNameAvailabilityParameters.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the CheckNameAvailability operation. + public partial class ApiManagementServiceCheckNameAvailabilityParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceCheckNameAvailabilityParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceCheckNameAvailabilityParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceCheckNameAvailabilityParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceCheckNameAvailabilityParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceCheckNameAvailabilityParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetDomainOwnershipIdentifierResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetDomainOwnershipIdentifierResult.cs new file mode 100644 index 000000000000..c31fa0963b1e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetDomainOwnershipIdentifierResult.cs @@ -0,0 +1,56 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Response of the GetDomainOwnershipIdentifier operation. + public partial class ApiManagementServiceGetDomainOwnershipIdentifierResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetDomainOwnershipIdentifierResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetDomainOwnershipIdentifierResultInternal + { + + /// Backing field for property. + private string _domainOwnershipIdentifier; + + /// The domain ownership identifier value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DomainOwnershipIdentifier { get => this._domainOwnershipIdentifier; } + + /// Internal Acessors for DomainOwnershipIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetDomainOwnershipIdentifierResultInternal.DomainOwnershipIdentifier { get => this._domainOwnershipIdentifier; set { {_domainOwnershipIdentifier = value;} } } + + /// + /// Creates an new instance. + /// + public ApiManagementServiceGetDomainOwnershipIdentifierResult() + { + + } + } + /// Response of the GetDomainOwnershipIdentifier operation. + public partial interface IApiManagementServiceGetDomainOwnershipIdentifierResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The domain ownership identifier value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The domain ownership identifier value.", + SerializedName = @"domainOwnershipIdentifier", + PossibleTypes = new [] { typeof(string) })] + string DomainOwnershipIdentifier { get; } + + } + /// Response of the GetDomainOwnershipIdentifier operation. + internal partial interface IApiManagementServiceGetDomainOwnershipIdentifierResultInternal + + { + /// The domain ownership identifier value. + string DomainOwnershipIdentifier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetDomainOwnershipIdentifierResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetDomainOwnershipIdentifierResult.json.cs new file mode 100644 index 000000000000..6da79f4b3a24 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetDomainOwnershipIdentifierResult.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Response of the GetDomainOwnershipIdentifier operation. + public partial class ApiManagementServiceGetDomainOwnershipIdentifierResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceGetDomainOwnershipIdentifierResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_domainOwnershipIdentifier = If( json?.PropertyT("domainOwnershipIdentifier"), out var __jsonDomainOwnershipIdentifier) ? (string)__jsonDomainOwnershipIdentifier : (string)DomainOwnershipIdentifier;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetDomainOwnershipIdentifierResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetDomainOwnershipIdentifierResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetDomainOwnershipIdentifierResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceGetDomainOwnershipIdentifierResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._domainOwnershipIdentifier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._domainOwnershipIdentifier.ToString()) : null, "domainOwnershipIdentifier" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetSsoTokenResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetSsoTokenResult.cs new file mode 100644 index 000000000000..0bf960848064 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetSsoTokenResult.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the GetSsoToken operation. + public partial class ApiManagementServiceGetSsoTokenResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetSsoTokenResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetSsoTokenResultInternal + { + + /// Backing field for property. + private string _redirectUri; + + /// Redirect URL to the Publisher Portal containing the SSO token. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string RedirectUri { get => this._redirectUri; set => this._redirectUri = value; } + + /// Creates an new instance. + public ApiManagementServiceGetSsoTokenResult() + { + + } + } + /// The response of the GetSsoToken operation. + public partial interface IApiManagementServiceGetSsoTokenResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Redirect URL to the Publisher Portal containing the SSO token. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect URL to the Publisher Portal containing the SSO token.", + SerializedName = @"redirectUri", + PossibleTypes = new [] { typeof(string) })] + string RedirectUri { get; set; } + + } + /// The response of the GetSsoToken operation. + internal partial interface IApiManagementServiceGetSsoTokenResultInternal + + { + /// Redirect URL to the Publisher Portal containing the SSO token. + string RedirectUri { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetSsoTokenResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetSsoTokenResult.json.cs new file mode 100644 index 000000000000..301959f98b08 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceGetSsoTokenResult.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the GetSsoToken operation. + public partial class ApiManagementServiceGetSsoTokenResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceGetSsoTokenResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_redirectUri = If( json?.PropertyT("redirectUri"), out var __jsonRedirectUri) ? (string)__jsonRedirectUri : (string)RedirectUri;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetSsoTokenResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetSsoTokenResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceGetSsoTokenResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceGetSsoTokenResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._redirectUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._redirectUri.ToString()) : null, "redirectUri" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentity.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentity.cs new file mode 100644 index 000000000000..d326fcceda1e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentity.cs @@ -0,0 +1,135 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity properties of the Api Management service resource. + public partial class ApiManagementServiceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal + { + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Backing field for property. + private string _principalId; + + /// The principal id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; } + + /// Backing field for property. + private string _tenantId; + + /// The client tenant id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType _type; + + /// + /// The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities _userAssignedIdentity; + + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } + + /// Creates an new instance. + public ApiManagementServiceIdentity() + { + + } + } + /// Identity properties of the Api Management service resource. + public partial interface IApiManagementServiceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The principal id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal id of the identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; } + /// The client tenant id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The client tenant id of the identity.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; } + /// + /// The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType Type { get; set; } + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity + dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } + + } + /// Identity properties of the Api Management service resource. + internal partial interface IApiManagementServiceIdentityInternal + + { + /// The principal id of the identity. + string PrincipalId { get; set; } + /// The client tenant id of the identity. + string TenantId { get; set; } + /// + /// The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType Type { get; set; } + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentity.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentity.json.cs new file mode 100644 index 000000000000..df6aa7081aa9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentity.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity properties of the Api Management service resource. + public partial class ApiManagementServiceIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceIdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : UserAssignedIdentity;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + } + AddIf( null != this._userAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._userAssignedIdentity.ToJson(null,serializationMode) : null, "userAssignedIdentities" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentityUserAssignedIdentities.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentityUserAssignedIdentities.cs new file mode 100644 index 000000000000..9919500dceb9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentityUserAssignedIdentities.cs @@ -0,0 +1,48 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public partial class ApiManagementServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentitiesInternal + { + + /// + /// Creates an new instance. + /// + public ApiManagementServiceIdentityUserAssignedIdentities() + { + + } + } + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public partial interface IApiManagementServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + internal partial interface IApiManagementServiceIdentityUserAssignedIdentitiesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentityUserAssignedIdentities.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentityUserAssignedIdentities.dictionary.cs new file mode 100644 index 000000000000..df5a85b662c4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentityUserAssignedIdentities.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityProperties this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityProperties value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityProperties value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceIdentityUserAssignedIdentities source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentityUserAssignedIdentities.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentityUserAssignedIdentities.json.cs new file mode 100644 index 000000000000..b6bb5156af4d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceIdentityUserAssignedIdentities.json.cs @@ -0,0 +1,117 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public partial class ApiManagementServiceIdentityUserAssignedIdentities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ApiManagementServiceIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserIdentityProperties.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceIdentityUserAssignedIdentities(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceListResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceListResult.cs new file mode 100644 index 000000000000..4792f84b96cf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceListResult.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the List API Management services operation. + public partial class ApiManagementServiceListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// + /// Link to the next set of results. Not empty if Value contains incomplete list of API Management services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource[] _value; + + /// Result of the List API Management services operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ApiManagementServiceListResult() + { + + } + } + /// The response of the List API Management services operation. + public partial interface IApiManagementServiceListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Link to the next set of results. Not empty if Value contains incomplete list of API Management services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Link to the next set of results. Not empty if Value contains incomplete list of API Management services.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Result of the List API Management services operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Result of the List API Management services operation.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource[] Value { get; set; } + + } + /// The response of the List API Management services operation. + internal partial interface IApiManagementServiceListResultInternal + + { + /// + /// Link to the next set of results. Not empty if Value contains incomplete list of API Management services. + /// + string NextLink { get; set; } + /// Result of the List API Management services operation. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceListResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceListResult.json.cs new file mode 100644 index 000000000000..a4fa80ae0e06 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceListResult.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the List API Management services operation. + public partial class ApiManagementServiceListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceListResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceResource.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceNameAvailabilityResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceNameAvailabilityResult.cs new file mode 100644 index 000000000000..d20169dc57cf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceNameAvailabilityResult.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Response of the CheckNameAvailability operation. + public partial class ApiManagementServiceNameAvailabilityResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceNameAvailabilityResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceNameAvailabilityResultInternal + { + + /// Backing field for property. + private string _message; + + /// + /// If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming + /// requirements so that the user can select a valid name. If reason == AlreadyExists, explain that is already + /// in use, and direct them to select a different name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceNameAvailabilityResultInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for NameAvailable + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceNameAvailabilityResultInternal.NameAvailable { get => this._nameAvailable; set { {_nameAvailable = value;} } } + + /// Backing field for property. + private bool? _nameAvailable; + + /// + /// True if the name is available and can be used to create a new API Management service; otherwise false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? NameAvailable { get => this._nameAvailable; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason? _reason; + + /// + /// Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported + /// characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason? Reason { get => this._reason; set => this._reason = value; } + + /// + /// Creates an new instance. + /// + public ApiManagementServiceNameAvailabilityResult() + { + + } + } + /// Response of the CheckNameAvailability operation. + public partial interface IApiManagementServiceNameAvailabilityResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming + /// requirements so that the user can select a valid name. If reason == AlreadyExists, explain that is already + /// in use, and direct them to select a different name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that is already in use, and direct them to select a different name.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// + /// True if the name is available and can be used to create a new API Management service; otherwise false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"True if the name is available and can be used to create a new API Management service; otherwise false.", + SerializedName = @"nameAvailable", + PossibleTypes = new [] { typeof(bool) })] + bool? NameAvailable { get; } + /// + /// Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported + /// characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable.", + SerializedName = @"reason", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason? Reason { get; set; } + + } + /// Response of the CheckNameAvailability operation. + internal partial interface IApiManagementServiceNameAvailabilityResultInternal + + { + /// + /// If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming + /// requirements so that the user can select a valid name. If reason == AlreadyExists, explain that is already + /// in use, and direct them to select a different name. + /// + string Message { get; set; } + /// + /// True if the name is available and can be used to create a new API Management service; otherwise false. + /// + bool? NameAvailable { get; set; } + /// + /// Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported + /// characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason? Reason { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceNameAvailabilityResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceNameAvailabilityResult.json.cs new file mode 100644 index 000000000000..7187b9ca3680 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceNameAvailabilityResult.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Response of the CheckNameAvailability operation. + public partial class ApiManagementServiceNameAvailabilityResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceNameAvailabilityResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_nameAvailable = If( json?.PropertyT("nameAvailable"), out var __jsonNameAvailable) ? (bool?)__jsonNameAvailable : NameAvailable;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_reason = If( json?.PropertyT("reason"), out var __jsonReason) ? (string)__jsonReason : (string)Reason;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceNameAvailabilityResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceNameAvailabilityResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceNameAvailabilityResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceNameAvailabilityResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._nameAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._nameAvailable) : null, "nameAvailable" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + AddIf( null != (((object)this._reason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._reason.ToString()) : null, "reason" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceProperties.cs new file mode 100644 index 000000000000..b23873bd62c9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceProperties.cs @@ -0,0 +1,341 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of an API Management service resource description. + public partial class ApiManagementServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServicePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBaseProperties __apiManagementServiceBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceBaseProperties(); + + /// Additional datacenter locations of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).AdditionalLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).AdditionalLocation = value ?? null /* arrayOf */; } + + /// Control Plane Apis version constraint for the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint ApiVersionConstraint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraint = value ?? null /* model class */; } + + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionConstraintMinApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraintMinApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraintMinApiVersion = value ?? null; } + + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Certificate = value ?? null /* arrayOf */; } + + /// Configuration API configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi ConfigurationApi { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ConfigurationApi; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ConfigurationApi = value ?? null /* model class */; } + + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ConfigurationApiLegacyApi; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ConfigurationApiLegacyApi = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState)""); } + + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public global::System.DateTime? CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CreatedAtUtc; } + + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CustomProperty = value ?? null /* model class */; } + + /// Status of developer portal in this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus)""); } + + /// DEveloper Portal endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalUrl; } + + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? DisableGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DisableGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DisableGateway = value ?? default(bool); } + + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? EnableClientCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).EnableClientCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).EnableClientCertificate = value ?? default(bool); } + + /// Gateway URL of the API Management service in the Default Region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayRegionalUrl; } + + /// Gateway URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayUrl; } + + /// Custom hostname configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).HostnameConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).HostnameConfiguration = value ?? null /* arrayOf */; } + + /// Status of legacy portal in the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).LegacyPortalStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).LegacyPortalStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus)""); } + + /// Management API endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl; } + + /// Internal Acessors for CreatedAtUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CreatedAtUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CreatedAtUtc = value; } + + /// Internal Acessors for DeveloperPortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalUrl = value; } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayRegionalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayRegionalUrl = value; } + + /// Internal Acessors for GatewayUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayUrl = value; } + + /// Internal Acessors for ManagementApiUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl = value; } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).OutboundPublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).OutboundPublicIPAddress = value; } + + /// Internal Acessors for PlatformVersion + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PlatformVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PlatformVersion = value; } + + /// Internal Acessors for PortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PortalUrl = value; } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateIPAddress = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ProvisioningState = value; } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddress = value; } + + /// Internal Acessors for ScmUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ScmUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ScmUrl = value; } + + /// Internal Acessors for TargetProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).TargetProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).TargetProvisioningState = value; } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationVnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationVnetid = value; } + + /// Property can be used to enable NAT Gateway for this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NatGatewayState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NatGatewayState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState)""); } + + /// Email address from which the notification will be sent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string NotificationSenderEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NotificationSenderEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NotificationSenderEmail = value ?? null; } + + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).OutboundPublicIPAddress; } + + /// Compute Platform Version running the service in this location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PlatformVersion; } + + /// Publisher portal endpoint Url of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PortalUrl; } + + /// List of Private Endpoint Connections of this service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateEndpointConnection = value ?? null /* arrayOf */; } + + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateIPAddress; } + + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ProvisioningState; } + + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddress; } + + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string PublicIPAddressId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddressId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddressId = value ?? null; } + + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess)""); } + + /// Backing field for property. + private string _publisherEmail; + + /// Publisher email. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PublisherEmail { get => this._publisherEmail; set => this._publisherEmail = value; } + + /// Backing field for property. + private string _publisherName; + + /// Publisher name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PublisherName { get => this._publisherName; set => this._publisherName = value; } + + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? Restore { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Restore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Restore = value ?? default(bool); } + + /// SCM endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ScmUrl; } + + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).TargetProvisioningState; } + + /// Virtual network configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfiguration = value ?? null /* model class */; } + + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string VirtualNetworkConfigurationSubnetResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetResourceId = value ?? null; } + + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetname; } + + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationVnetid; } + + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType)""); } + + /// Creates an new instance. + public ApiManagementServiceProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__apiManagementServiceBaseProperties), __apiManagementServiceBaseProperties); + await eventListener.AssertObjectIsValid(nameof(__apiManagementServiceBaseProperties), __apiManagementServiceBaseProperties); + } + } + /// Properties of an API Management service resource description. + public partial interface IApiManagementServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBaseProperties + { + /// Publisher email. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Publisher email.", + SerializedName = @"publisherEmail", + PossibleTypes = new [] { typeof(string) })] + string PublisherEmail { get; set; } + /// Publisher name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Publisher name.", + SerializedName = @"publisherName", + PossibleTypes = new [] { typeof(string) })] + string PublisherName { get; set; } + + } + /// Properties of an API Management service resource description. + internal partial interface IApiManagementServicePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal + { + /// Publisher email. + string PublisherEmail { get; set; } + /// Publisher name. + string PublisherName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceProperties.json.cs new file mode 100644 index 000000000000..312fa105a8d9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of an API Management service resource description. + public partial class ApiManagementServiceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __apiManagementServiceBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceBaseProperties(json); + {_publisherEmail = If( json?.PropertyT("publisherEmail"), out var __jsonPublisherEmail) ? (string)__jsonPublisherEmail : (string)PublisherEmail;} + {_publisherName = If( json?.PropertyT("publisherName"), out var __jsonPublisherName) ? (string)__jsonPublisherName : (string)PublisherName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __apiManagementServiceBaseProperties?.ToJson(container, serializationMode); + AddIf( null != (((object)this._publisherEmail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._publisherEmail.ToString()) : null, "publisherEmail" ,container.Add ); + AddIf( null != (((object)this._publisherName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._publisherName.ToString()) : null, "publisherName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceResource.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceResource.cs new file mode 100644 index 000000000000..aae0b5801ab5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceResource.cs @@ -0,0 +1,1142 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A single API Management service resource in List or Get response. + public partial class ApiManagementServiceResource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResource __apimResource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApimResource(); + + /// Additional datacenter locations of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).AdditionalLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).AdditionalLocation = value ?? null /* arrayOf */; } + + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionConstraintMinApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraintMinApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraintMinApiVersion = value ?? null; } + + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).Certificate = value ?? null /* arrayOf */; } + + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ConfigurationApiLegacyApi; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ConfigurationApiLegacyApi = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState)""); } + + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).CreatedAtUtc; } + + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).CustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).CustomProperty = value ?? null /* model class */; } + + /// Status of developer portal in this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus)""); } + + /// DEveloper Portal endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalUrl; } + + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? DisableGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DisableGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DisableGateway = value ?? default(bool); } + + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? EnableClientCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).EnableClientCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).EnableClientCertificate = value ?? default(bool); } + + /// Backing field for property. + private string _etag; + + /// ETag of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Gateway URL of the API Management service in the Default Region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayRegionalUrl; } + + /// Gateway URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayUrl; } + + /// Custom hostname configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).HostnameConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).HostnameConfiguration = value ?? null /* arrayOf */; } + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity _identity; + + /// Managed service identity of the Api Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceIdentity()); set => this._identity = value; } + + /// The principal id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).PrincipalId; } + + /// The client tenant id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).TenantId; } + + /// + /// The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType)""); } + + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// Status of legacy portal in the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).LegacyPortalStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).LegacyPortalStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus)""); } + + /// Backing field for property. + private string _location; + + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Management API endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl; } + + /// Internal Acessors for ApiVersionConstraint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.ApiVersionConstraint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraint = value; } + + /// Internal Acessors for ConfigurationApi + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.ConfigurationApi { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ConfigurationApi; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ConfigurationApi = value; } + + /// Internal Acessors for CreatedAtUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).CreatedAtUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).CreatedAtUtc = value; } + + /// Internal Acessors for DeveloperPortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalUrl = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayRegionalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayRegionalUrl = value; } + + /// Internal Acessors for GatewayUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayUrl = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for ManagementApiUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl = value; } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).OutboundPublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).OutboundPublicIPAddress = value; } + + /// Internal Acessors for PlatformVersion + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PlatformVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PlatformVersion = value; } + + /// Internal Acessors for PortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PortalUrl = value; } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddress = value; } + + /// Internal Acessors for ScmUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceSkuProperties()); set { {_sku = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for TargetProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).TargetProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).TargetProvisioningState = value; } + + /// Internal Acessors for VirtualNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.VirtualNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfiguration = value; } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationVnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationVnetid = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Name; } + + /// Property can be used to enable NAT Gateway for this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).NatGatewayState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).NatGatewayState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState)""); } + + /// Email address from which the notification will be sent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string NotificationSenderEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).NotificationSenderEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).NotificationSenderEmail = value ?? null; } + + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).OutboundPublicIPAddress; } + + /// Compute Platform Version running the service in this location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PlatformVersion; } + + /// Publisher portal endpoint Url of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PortalUrl; } + + /// List of Private Endpoint Connections of this service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PrivateEndpointConnection = value ?? null /* arrayOf */; } + + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceProperties _property; + + /// Properties of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceProperties()); set => this._property = value; } + + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ProvisioningState; } + + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddress; } + + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PublicIPAddressId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddressId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddressId = value ?? null; } + + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess)""); } + + /// Publisher email. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PublisherEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServicePropertiesInternal)Property).PublisherEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServicePropertiesInternal)Property).PublisherEmail = value ; } + + /// Publisher name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PublisherName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServicePropertiesInternal)Property).PublisherName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServicePropertiesInternal)Property).PublisherName = value ; } + + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Restore { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).Restore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).Restore = value ?? default(bool); } + + /// SCM endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties _sku; + + /// SKU properties of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceSkuProperties()); set => this._sku = value; } + + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int SkuCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Capacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Capacity = value ; } + + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Name = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Tag = value ?? null /* model class */; } + + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).TargetProvisioningState; } + + /// Resource type for API Management resource is set to Microsoft.ApiManagement. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Type; } + + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationSubnetResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetResourceId = value ?? null; } + + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetname; } + + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationVnetid; } + + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType)""); } + + /// Backing field for property. + private string[] _zone; + + /// A list of availability zones denoting where the resource needs to come from. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Zone { get => this._zone; set => this._zone = value; } + + /// Creates an new instance. + public ApiManagementServiceResource() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResourceInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__apimResource), __apimResource); + await eventListener.AssertObjectIsValid(nameof(__apimResource), __apimResource); + } + } + /// A single API Management service resource in List or Get response. + public partial interface IApiManagementServiceResource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResource + { + /// Additional datacenter locations of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional datacenter locations of the API Management service.", + SerializedName = @"additionalLocations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get; set; } + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Limit control plane API calls to API Management service with version equal to or newer than this value.", + SerializedName = @"minApiVersion", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionConstraintMinApiVersion { get; set; } + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.", + SerializedName = @"certificates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get; set; } + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted gateways. Default value is 'Enabled'", + SerializedName = @"legacyApi", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get; set; } + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.", + SerializedName = @"createdAtUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedAtUtc { get; } + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + SerializedName = @"customProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get; set; } + /// Status of developer portal in this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of developer portal in this API Management service.", + SerializedName = @"developerPortalStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get; set; } + /// DEveloper Portal endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"DEveloper Portal endpoint URL of the API Management service.", + SerializedName = @"developerPortalUrl", + PossibleTypes = new [] { typeof(string) })] + string DeveloperPortalUrl { get; } + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.", + SerializedName = @"disableGateway", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableGateway { get; set; } + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway.", + SerializedName = @"enableClientCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableClientCertificate { get; set; } + /// ETag of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ETag of the resource.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// Gateway URL of the API Management service in the Default Region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gateway URL of the API Management service in the Default Region.", + SerializedName = @"gatewayRegionalUrl", + PossibleTypes = new [] { typeof(string) })] + string GatewayRegionalUrl { get; } + /// Gateway URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gateway URL of the API Management service.", + SerializedName = @"gatewayUrl", + PossibleTypes = new [] { typeof(string) })] + string GatewayUrl { get; } + /// Custom hostname configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Custom hostname configuration of the API Management service.", + SerializedName = @"hostnameConfigurations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get; set; } + /// The principal id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal id of the identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; } + /// The client tenant id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The client tenant id of the identity.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; } + /// + /// The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity + dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Status of legacy portal in the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of legacy portal in the API Management service.", + SerializedName = @"legacyPortalStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get; set; } + /// Resource location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// Management API endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Management API endpoint URL of the API Management service.", + SerializedName = @"managementApiUrl", + PossibleTypes = new [] { typeof(string) })] + string ManagementApiUrl { get; } + /// Property can be used to enable NAT Gateway for this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property can be used to enable NAT Gateway for this API Management service.", + SerializedName = @"natGatewayState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get; set; } + /// Email address from which the notification will be sent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email address from which the notification will be sent.", + SerializedName = @"notificationSenderEmail", + PossibleTypes = new [] { typeof(string) })] + string NotificationSenderEmail { get; set; } + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on stv2 platform.", + SerializedName = @"outboundPublicIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] OutboundPublicIPAddress { get; } + /// Compute Platform Version running the service in this location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Compute Platform Version running the service in this location.", + SerializedName = @"platformVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get; } + /// Publisher portal endpoint Url of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Publisher portal endpoint Url of the API Management service.", + SerializedName = @"portalUrl", + PossibleTypes = new [] { typeof(string) })] + string PortalUrl { get; } + /// List of Private Endpoint Connections of this service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Private Endpoint Connections of this service.", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get; set; } + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU.", + SerializedName = @"privateIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] PrivateIPAddress { get; } + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU.", + SerializedName = @"publicIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] PublicIPAddress { get; } + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network.", + SerializedName = @"publicIpAddressId", + PossibleTypes = new [] { typeof(string) })] + string PublicIPAddressId { get; set; } + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// Publisher email. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Publisher email.", + SerializedName = @"publisherEmail", + PossibleTypes = new [] { typeof(string) })] + string PublisherEmail { get; set; } + /// Publisher name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Publisher name.", + SerializedName = @"publisherName", + PossibleTypes = new [] { typeof(string) })] + string PublisherName { get; set; } + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored.", + SerializedName = @"restore", + PossibleTypes = new [] { typeof(bool) })] + bool? Restore { get; set; } + /// SCM endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"SCM endpoint URL of the API Management service.", + SerializedName = @"scmUrl", + PossibleTypes = new [] { typeof(string) })] + string ScmUrl { get; } + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0.", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(int) })] + int SkuCapacity { get; set; } + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Sku.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType SkuName { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state of the API Management service, which is targeted by the long running operation started on the service.", + SerializedName = @"targetProvisioningState", + PossibleTypes = new [] { typeof(string) })] + string TargetProvisioningState { get; } + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full resource ID of a subnet in a virtual network to deploy the API Management service in.", + SerializedName = @"subnetResourceId", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationSubnetResourceId { get; set; } + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the subnet.", + SerializedName = @"subnetname", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationSubnetname { get; } + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The virtual network ID. This is typically a GUID. Expect a null GUID by default.", + SerializedName = @"vnetid", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationVnetid { get; } + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only.", + SerializedName = @"virtualNetworkType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get; set; } + /// A list of availability zones denoting where the resource needs to come from. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of availability zones denoting where the resource needs to come from.", + SerializedName = @"zones", + PossibleTypes = new [] { typeof(string) })] + string[] Zone { get; set; } + + } + /// A single API Management service resource in List or Get response. + internal partial interface IApiManagementServiceResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal + { + /// Additional datacenter locations of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get; set; } + /// Control Plane Apis version constraint for the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint ApiVersionConstraint { get; set; } + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + string ApiVersionConstraintMinApiVersion { get; set; } + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get; set; } + /// Configuration API configuration of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi ConfigurationApi { get; set; } + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get; set; } + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? CreatedAtUtc { get; set; } + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get; set; } + /// Status of developer portal in this API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get; set; } + /// DEveloper Portal endpoint URL of the API Management service. + string DeveloperPortalUrl { get; set; } + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + bool? DisableGateway { get; set; } + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + bool? EnableClientCertificate { get; set; } + /// ETag of the resource. + string Etag { get; set; } + /// Gateway URL of the API Management service in the Default Region. + string GatewayRegionalUrl { get; set; } + /// Gateway URL of the API Management service. + string GatewayUrl { get; set; } + /// Custom hostname configuration of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get; set; } + /// Managed service identity of the Api Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity Identity { get; set; } + /// The principal id of the identity. + string IdentityPrincipalId { get; set; } + /// The client tenant id of the identity. + string IdentityTenantId { get; set; } + /// + /// The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Status of legacy portal in the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get; set; } + /// Resource location. + string Location { get; set; } + /// Management API endpoint URL of the API Management service. + string ManagementApiUrl { get; set; } + /// Property can be used to enable NAT Gateway for this API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get; set; } + /// Email address from which the notification will be sent. + string NotificationSenderEmail { get; set; } + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + string[] OutboundPublicIPAddress { get; set; } + /// Compute Platform Version running the service in this location. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get; set; } + /// Publisher portal endpoint Url of the API Management service. + string PortalUrl { get; set; } + /// List of Private Endpoint Connections of this service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get; set; } + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + string[] PrivateIPAddress { get; set; } + /// Properties of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceProperties Property { get; set; } + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + string ProvisioningState { get; set; } + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + string[] PublicIPAddress { get; set; } + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + string PublicIPAddressId { get; set; } + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// Publisher email. + string PublisherEmail { get; set; } + /// Publisher name. + string PublisherName { get; set; } + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + bool? Restore { get; set; } + /// SCM endpoint URL of the API Management service. + string ScmUrl { get; set; } + /// SKU properties of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties Sku { get; set; } + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + int SkuCapacity { get; set; } + /// Name of the Sku. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType SkuName { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + string TargetProvisioningState { get; set; } + /// Virtual network configuration of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get; set; } + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + string VirtualNetworkConfigurationSubnetResourceId { get; set; } + /// The name of the subnet. + string VirtualNetworkConfigurationSubnetname { get; set; } + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + string VirtualNetworkConfigurationVnetid { get; set; } + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get; set; } + /// A list of availability zones denoting where the resource needs to come from. + string[] Zone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceResource.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceResource.json.cs new file mode 100644 index 000000000000..c004fb42ab4b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceResource.json.cs @@ -0,0 +1,136 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A single API Management service resource in List or Get response. + public partial class ApiManagementServiceResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceResource(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __apimResource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApimResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceProperties.FromJson(__jsonProperties) : Property;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceSkuProperties.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceIdentity.FromJson(__jsonIdentity) : Identity;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Zone;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __apimResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + } + if (null != this._zone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._zone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("zones",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceSkuProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceSkuProperties.cs new file mode 100644 index 000000000000..65698fe1469e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceSkuProperties.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Management service resource SKU properties. + public partial class ApiManagementServiceSkuProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal + { + + /// Backing field for property. + private int _capacity; + + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int Capacity { get => this._capacity; set => this._capacity = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType _name; + + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public ApiManagementServiceSkuProperties() + { + + } + } + /// API Management service resource SKU properties. + public partial interface IApiManagementServiceSkuProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0.", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(int) })] + int Capacity { get; set; } + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the Sku.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType Name { get; set; } + + } + /// API Management service resource SKU properties. + internal partial interface IApiManagementServiceSkuPropertiesInternal + + { + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + int Capacity { get; set; } + /// Name of the Sku. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceSkuProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceSkuProperties.json.cs new file mode 100644 index 000000000000..8913475f2c20 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceSkuProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Management service resource SKU properties. + public partial class ApiManagementServiceSkuProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceSkuProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? (int)__jsonCapacity : Capacity;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceSkuProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber(this._capacity), "capacity" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateParameters.cs new file mode 100644 index 000000000000..1619fc8dbdab --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateParameters.cs @@ -0,0 +1,1019 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameter supplied to Update Api Management Service. + public partial class ApiManagementServiceUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResource __apimResource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApimResource(); + + /// Additional datacenter locations of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).AdditionalLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).AdditionalLocation = value ?? null /* arrayOf */; } + + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionConstraintMinApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraintMinApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraintMinApiVersion = value ?? null; } + + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).Certificate = value ?? null /* arrayOf */; } + + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ConfigurationApiLegacyApi; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ConfigurationApiLegacyApi = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState)""); } + + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).CreatedAtUtc; } + + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).CustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).CustomProperty = value ?? null /* model class */; } + + /// Status of developer portal in this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus)""); } + + /// DEveloper Portal endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalUrl; } + + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? DisableGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DisableGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DisableGateway = value ?? default(bool); } + + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? EnableClientCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).EnableClientCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).EnableClientCertificate = value ?? default(bool); } + + /// Backing field for property. + private string _etag; + + /// ETag of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Gateway URL of the API Management service in the Default Region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayRegionalUrl; } + + /// Gateway URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayUrl; } + + /// Custom hostname configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).HostnameConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).HostnameConfiguration = value ?? null /* arrayOf */; } + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity _identity; + + /// Managed service identity of the Api Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceIdentity()); set => this._identity = value; } + + /// The principal id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).PrincipalId; } + + /// The client tenant id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).TenantId; } + + /// + /// The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType)""); } + + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// Status of legacy portal in the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).LegacyPortalStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).LegacyPortalStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus)""); } + + /// Management API endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl; } + + /// Internal Acessors for ApiVersionConstraint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.ApiVersionConstraint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ApiVersionConstraint = value; } + + /// Internal Acessors for ConfigurationApi + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.ConfigurationApi { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ConfigurationApi; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ConfigurationApi = value; } + + /// Internal Acessors for CreatedAtUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).CreatedAtUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).CreatedAtUtc = value; } + + /// Internal Acessors for DeveloperPortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).DeveloperPortalUrl = value; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayRegionalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayRegionalUrl = value; } + + /// Internal Acessors for GatewayUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).GatewayUrl = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for ManagementApiUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ManagementApiUrl = value; } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).OutboundPublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).OutboundPublicIPAddress = value; } + + /// Internal Acessors for PlatformVersion + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PlatformVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PlatformVersion = value; } + + /// Internal Acessors for PortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PortalUrl = value; } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceUpdateProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddress = value; } + + /// Internal Acessors for ScmUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceSkuProperties()); set { {_sku = value;} } } + + /// Internal Acessors for TargetProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).TargetProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).TargetProvisioningState = value; } + + /// Internal Acessors for VirtualNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.VirtualNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfiguration = value; } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParametersInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationVnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationVnetid = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Name; } + + /// Property can be used to enable NAT Gateway for this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).NatGatewayState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).NatGatewayState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState)""); } + + /// Email address from which the notification will be sent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string NotificationSenderEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).NotificationSenderEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).NotificationSenderEmail = value ?? null; } + + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).OutboundPublicIPAddress; } + + /// Compute Platform Version running the service in this location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PlatformVersion; } + + /// Publisher portal endpoint Url of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PortalUrl; } + + /// List of Private Endpoint Connections of this service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PrivateEndpointConnection = value ?? null /* arrayOf */; } + + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PrivateIPAddress; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateProperties _property; + + /// Properties of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceUpdateProperties()); set => this._property = value; } + + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ProvisioningState; } + + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddress; } + + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PublicIPAddressId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddressId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicIPAddressId = value ?? null; } + + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess)""); } + + /// Publisher email. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PublisherEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdatePropertiesInternal)Property).PublisherEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdatePropertiesInternal)Property).PublisherEmail = value ?? null; } + + /// Publisher name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PublisherName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdatePropertiesInternal)Property).PublisherName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdatePropertiesInternal)Property).PublisherName = value ?? null; } + + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Restore { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).Restore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).Restore = value ?? default(bool); } + + /// SCM endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).ScmUrl; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties _sku; + + /// SKU properties of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceSkuProperties()); set => this._sku = value; } + + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? SkuCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Capacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Capacity = value ?? default(int); } + + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuPropertiesInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Tag = value ?? null /* model class */; } + + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).TargetProvisioningState; } + + /// Resource type for API Management resource is set to Microsoft.ApiManagement. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal)__apimResource).Type; } + + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationSubnetResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetResourceId = value ?? null; } + + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationSubnetname; } + + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkConfigurationVnetid; } + + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)Property).VirtualNetworkType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType)""); } + + /// Backing field for property. + private string[] _zone; + + /// A list of availability zones denoting where the resource needs to come from. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Zone { get => this._zone; set => this._zone = value; } + + /// Creates an new instance. + public ApiManagementServiceUpdateParameters() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__apimResource), __apimResource); + await eventListener.AssertObjectIsValid(nameof(__apimResource), __apimResource); + } + } + /// Parameter supplied to Update Api Management Service. + public partial interface IApiManagementServiceUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResource + { + /// Additional datacenter locations of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional datacenter locations of the API Management service.", + SerializedName = @"additionalLocations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get; set; } + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Limit control plane API calls to API Management service with version equal to or newer than this value.", + SerializedName = @"minApiVersion", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionConstraintMinApiVersion { get; set; } + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.", + SerializedName = @"certificates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get; set; } + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted gateways. Default value is 'Enabled'", + SerializedName = @"legacyApi", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get; set; } + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.", + SerializedName = @"createdAtUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedAtUtc { get; } + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + SerializedName = @"customProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get; set; } + /// Status of developer portal in this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of developer portal in this API Management service.", + SerializedName = @"developerPortalStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get; set; } + /// DEveloper Portal endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"DEveloper Portal endpoint URL of the API Management service.", + SerializedName = @"developerPortalUrl", + PossibleTypes = new [] { typeof(string) })] + string DeveloperPortalUrl { get; } + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.", + SerializedName = @"disableGateway", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableGateway { get; set; } + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway.", + SerializedName = @"enableClientCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableClientCertificate { get; set; } + /// ETag of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ETag of the resource.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// Gateway URL of the API Management service in the Default Region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gateway URL of the API Management service in the Default Region.", + SerializedName = @"gatewayRegionalUrl", + PossibleTypes = new [] { typeof(string) })] + string GatewayRegionalUrl { get; } + /// Gateway URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gateway URL of the API Management service.", + SerializedName = @"gatewayUrl", + PossibleTypes = new [] { typeof(string) })] + string GatewayUrl { get; } + /// Custom hostname configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Custom hostname configuration of the API Management service.", + SerializedName = @"hostnameConfigurations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get; set; } + /// The principal id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal id of the identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; } + /// The client tenant id of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The client tenant id of the identity.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; } + /// + /// The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of user identities associated with the resource. The user identity + dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Status of legacy portal in the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of legacy portal in the API Management service.", + SerializedName = @"legacyPortalStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get; set; } + /// Management API endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Management API endpoint URL of the API Management service.", + SerializedName = @"managementApiUrl", + PossibleTypes = new [] { typeof(string) })] + string ManagementApiUrl { get; } + /// Property can be used to enable NAT Gateway for this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property can be used to enable NAT Gateway for this API Management service.", + SerializedName = @"natGatewayState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get; set; } + /// Email address from which the notification will be sent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email address from which the notification will be sent.", + SerializedName = @"notificationSenderEmail", + PossibleTypes = new [] { typeof(string) })] + string NotificationSenderEmail { get; set; } + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on stv2 platform.", + SerializedName = @"outboundPublicIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] OutboundPublicIPAddress { get; } + /// Compute Platform Version running the service in this location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Compute Platform Version running the service in this location.", + SerializedName = @"platformVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get; } + /// Publisher portal endpoint Url of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Publisher portal endpoint Url of the API Management service.", + SerializedName = @"portalUrl", + PossibleTypes = new [] { typeof(string) })] + string PortalUrl { get; } + /// List of Private Endpoint Connections of this service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Private Endpoint Connections of this service.", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get; set; } + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU.", + SerializedName = @"privateIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] PrivateIPAddress { get; } + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU.", + SerializedName = @"publicIPAddresses", + PossibleTypes = new [] { typeof(string) })] + string[] PublicIPAddress { get; } + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network.", + SerializedName = @"publicIpAddressId", + PossibleTypes = new [] { typeof(string) })] + string PublicIPAddressId { get; set; } + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// Publisher email. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Publisher email.", + SerializedName = @"publisherEmail", + PossibleTypes = new [] { typeof(string) })] + string PublisherEmail { get; set; } + /// Publisher name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Publisher name.", + SerializedName = @"publisherName", + PossibleTypes = new [] { typeof(string) })] + string PublisherName { get; set; } + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored.", + SerializedName = @"restore", + PossibleTypes = new [] { typeof(bool) })] + bool? Restore { get; set; } + /// SCM endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"SCM endpoint URL of the API Management service.", + SerializedName = @"scmUrl", + PossibleTypes = new [] { typeof(string) })] + string ScmUrl { get; } + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0.", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(int) })] + int? SkuCapacity { get; set; } + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the Sku.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType? SkuName { get; set; } + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state of the API Management service, which is targeted by the long running operation started on the service.", + SerializedName = @"targetProvisioningState", + PossibleTypes = new [] { typeof(string) })] + string TargetProvisioningState { get; } + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full resource ID of a subnet in a virtual network to deploy the API Management service in.", + SerializedName = @"subnetResourceId", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationSubnetResourceId { get; set; } + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the subnet.", + SerializedName = @"subnetname", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationSubnetname { get; } + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The virtual network ID. This is typically a GUID. Expect a null GUID by default.", + SerializedName = @"vnetid", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkConfigurationVnetid { get; } + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only.", + SerializedName = @"virtualNetworkType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get; set; } + /// A list of availability zones denoting where the resource needs to come from. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of availability zones denoting where the resource needs to come from.", + SerializedName = @"zones", + PossibleTypes = new [] { typeof(string) })] + string[] Zone { get; set; } + + } + /// Parameter supplied to Update Api Management Service. + internal partial interface IApiManagementServiceUpdateParametersInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal + { + /// Additional datacenter locations of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get; set; } + /// Control Plane Apis version constraint for the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint ApiVersionConstraint { get; set; } + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + string ApiVersionConstraintMinApiVersion { get; set; } + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get; set; } + /// Configuration API configuration of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi ConfigurationApi { get; set; } + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get; set; } + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? CreatedAtUtc { get; set; } + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get; set; } + /// Status of developer portal in this API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get; set; } + /// DEveloper Portal endpoint URL of the API Management service. + string DeveloperPortalUrl { get; set; } + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + bool? DisableGateway { get; set; } + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + bool? EnableClientCertificate { get; set; } + /// ETag of the resource. + string Etag { get; set; } + /// Gateway URL of the API Management service in the Default Region. + string GatewayRegionalUrl { get; set; } + /// Gateway URL of the API Management service. + string GatewayUrl { get; set; } + /// Custom hostname configuration of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get; set; } + /// Managed service identity of the Api Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentity Identity { get; set; } + /// The principal id of the identity. + string IdentityPrincipalId { get; set; } + /// The client tenant id of the identity. + string IdentityTenantId { get; set; } + /// + /// The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType? IdentityType { get; set; } + /// + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Status of legacy portal in the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get; set; } + /// Management API endpoint URL of the API Management service. + string ManagementApiUrl { get; set; } + /// Property can be used to enable NAT Gateway for this API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get; set; } + /// Email address from which the notification will be sent. + string NotificationSenderEmail { get; set; } + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + string[] OutboundPublicIPAddress { get; set; } + /// Compute Platform Version running the service in this location. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get; set; } + /// Publisher portal endpoint Url of the API Management service. + string PortalUrl { get; set; } + /// List of Private Endpoint Connections of this service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get; set; } + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + string[] PrivateIPAddress { get; set; } + /// Properties of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateProperties Property { get; set; } + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + string ProvisioningState { get; set; } + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + string[] PublicIPAddress { get; set; } + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + string PublicIPAddressId { get; set; } + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// Publisher email. + string PublisherEmail { get; set; } + /// Publisher name. + string PublisherName { get; set; } + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + bool? Restore { get; set; } + /// SCM endpoint URL of the API Management service. + string ScmUrl { get; set; } + /// SKU properties of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceSkuProperties Sku { get; set; } + /// + /// Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. + /// + int? SkuCapacity { get; set; } + /// Name of the Sku. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType? SkuName { get; set; } + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + string TargetProvisioningState { get; set; } + /// Virtual network configuration of the API Management service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get; set; } + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + string VirtualNetworkConfigurationSubnetResourceId { get; set; } + /// The name of the subnet. + string VirtualNetworkConfigurationSubnetname { get; set; } + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + string VirtualNetworkConfigurationVnetid { get; set; } + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get; set; } + /// A list of availability zones denoting where the resource needs to come from. + string[] Zone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateParameters.json.cs new file mode 100644 index 000000000000..ff6e5293134b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateParameters.json.cs @@ -0,0 +1,130 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameter supplied to Update Api Management Service. + public partial class ApiManagementServiceUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __apimResource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApimResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceUpdateProperties.FromJson(__jsonProperties) : Property;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceSkuProperties.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceIdentity.FromJson(__jsonIdentity) : Identity;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Zone;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __apimResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + } + if (null != this._zone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._zone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("zones",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateProperties.cs new file mode 100644 index 000000000000..c86442eb430b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateProperties.cs @@ -0,0 +1,341 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of an API Management service resource description. + public partial class ApiManagementServiceUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdatePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBaseProperties __apiManagementServiceBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceBaseProperties(); + + /// Additional datacenter locations of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAdditionalLocation[] AdditionalLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).AdditionalLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).AdditionalLocation = value ?? null /* arrayOf */; } + + /// Control Plane Apis version constraint for the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint ApiVersionConstraint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraint = value ?? null /* model class */; } + + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionConstraintMinApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraintMinApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ApiVersionConstraintMinApiVersion = value ?? null; } + + /// + /// List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed + /// is 10. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration[] Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Certificate = value ?? null /* arrayOf */; } + + /// Configuration API configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi ConfigurationApi { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ConfigurationApi; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ConfigurationApi = value ?? null /* model class */; } + + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? ConfigurationApiLegacyApi { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ConfigurationApiLegacyApi; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ConfigurationApiLegacyApi = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState)""); } + + /// + /// Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public global::System.DateTime? CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CreatedAtUtc; } + + /// + /// Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + /// will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + /// can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + /// can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + /// can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + /// can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + /// can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH + /// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value + /// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is + /// `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + /// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + /// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + /// The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal + /// platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesCustomProperties CustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CustomProperty = value ?? null /* model class */; } + + /// Status of developer portal in this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus? DeveloperPortalStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus)""); } + + /// DEveloper Portal endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalUrl; } + + /// + /// Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway + /// in master region. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? DisableGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DisableGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DisableGateway = value ?? default(bool); } + + /// + /// Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each + /// request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? EnableClientCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).EnableClientCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).EnableClientCertificate = value ?? default(bool); } + + /// Gateway URL of the API Management service in the Default Region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayRegionalUrl; } + + /// Gateway URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayUrl; } + + /// Custom hostname configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration[] HostnameConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).HostnameConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).HostnameConfiguration = value ?? null /* arrayOf */; } + + /// Status of legacy portal in the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus? LegacyPortalStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).LegacyPortalStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).LegacyPortalStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus)""); } + + /// Management API endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl; } + + /// Internal Acessors for CreatedAtUtc + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.CreatedAtUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CreatedAtUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).CreatedAtUtc = value; } + + /// Internal Acessors for DeveloperPortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.DeveloperPortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).DeveloperPortalUrl = value; } + + /// Internal Acessors for GatewayRegionalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.GatewayRegionalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayRegionalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayRegionalUrl = value; } + + /// Internal Acessors for GatewayUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.GatewayUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).GatewayUrl = value; } + + /// Internal Acessors for ManagementApiUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ManagementApiUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ManagementApiUrl = value; } + + /// Internal Acessors for OutboundPublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).OutboundPublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).OutboundPublicIPAddress = value; } + + /// Internal Acessors for PlatformVersion + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PlatformVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PlatformVersion = value; } + + /// Internal Acessors for PortalUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PortalUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PortalUrl = value; } + + /// Internal Acessors for PrivateIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateIPAddress = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ProvisioningState = value; } + + /// Internal Acessors for PublicIPAddress + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddress = value; } + + /// Internal Acessors for ScmUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ScmUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ScmUrl = value; } + + /// Internal Acessors for TargetProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).TargetProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).TargetProvisioningState = value; } + + /// Internal Acessors for VirtualNetworkConfigurationSubnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetname = value; } + + /// Internal Acessors for VirtualNetworkConfigurationVnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal.VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationVnetid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationVnetid = value; } + + /// Property can be used to enable NAT Gateway for this API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState? NatGatewayState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NatGatewayState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NatGatewayState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState)""); } + + /// Email address from which the notification will be sent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string NotificationSenderEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NotificationSenderEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).NotificationSenderEmail = value ?? null; } + + /// + /// Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on + /// stv2 platform. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] OutboundPublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).OutboundPublicIPAddress; } + + /// Compute Platform Version running the service in this location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion? PlatformVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PlatformVersion; } + + /// Publisher portal endpoint Url of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string PortalUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PortalUrl; } + + /// List of Private Endpoint Connections of this service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateEndpointConnection = value ?? null /* arrayOf */; } + + /// + /// Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal + /// Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] PrivateIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PrivateIPAddress; } + + /// + /// The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ProvisioningState; } + + /// + /// Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, + /// Premium and Isolated SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] PublicIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddress; } + + /// + /// Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported + /// only for Developer and Premium SKU being deployed in Virtual Network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string PublicIPAddressId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddressId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicIPAddressId = value ?? null; } + + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess)""); } + + /// Backing field for property. + private string _publisherEmail; + + /// Publisher email. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PublisherEmail { get => this._publisherEmail; set => this._publisherEmail = value; } + + /// Backing field for property. + private string _publisherName; + + /// Publisher name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PublisherName { get => this._publisherName; set => this._publisherName = value; } + + /// + /// Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other + /// properties will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? Restore { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Restore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).Restore = value ?? default(bool); } + + /// SCM endpoint URL of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ScmUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).ScmUrl; } + + /// + /// The provisioning state of the API Management service, which is targeted by the long running operation started on the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string TargetProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).TargetProvisioningState; } + + /// Virtual network configuration of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration VirtualNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfiguration = value ?? null /* model class */; } + + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string VirtualNetworkConfigurationSubnetResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetResourceId = value ?? null; } + + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string VirtualNetworkConfigurationSubnetname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationSubnetname; } + + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string VirtualNetworkConfigurationVnetid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkConfigurationVnetid; } + + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType? VirtualNetworkType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal)__apiManagementServiceBaseProperties).VirtualNetworkType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType)""); } + + /// Creates an new instance. + public ApiManagementServiceUpdateProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__apiManagementServiceBaseProperties), __apiManagementServiceBaseProperties); + await eventListener.AssertObjectIsValid(nameof(__apiManagementServiceBaseProperties), __apiManagementServiceBaseProperties); + } + } + /// Properties of an API Management service resource description. + public partial interface IApiManagementServiceUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBaseProperties + { + /// Publisher email. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Publisher email.", + SerializedName = @"publisherEmail", + PossibleTypes = new [] { typeof(string) })] + string PublisherEmail { get; set; } + /// Publisher name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Publisher name.", + SerializedName = @"publisherName", + PossibleTypes = new [] { typeof(string) })] + string PublisherName { get; set; } + + } + /// Properties of an API Management service resource description. + internal partial interface IApiManagementServiceUpdatePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceBasePropertiesInternal + { + /// Publisher email. + string PublisherEmail { get; set; } + /// Publisher name. + string PublisherName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateProperties.json.cs new file mode 100644 index 000000000000..f3e4c416218c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementServiceUpdateProperties.json.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of an API Management service resource description. + public partial class ApiManagementServiceUpdateProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __apiManagementServiceBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementServiceBaseProperties(json); + {_publisherEmail = If( json?.PropertyT("publisherEmail"), out var __jsonPublisherEmail) ? (string)__jsonPublisherEmail : (string)PublisherEmail;} + {_publisherName = If( json?.PropertyT("publisherName"), out var __jsonPublisherName) ? (string)__jsonPublisherName : (string)PublisherName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementServiceUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceUpdateProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __apiManagementServiceBaseProperties?.ToJson(container, serializationMode); + AddIf( null != (((object)this._publisherEmail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._publisherEmail.ToString()) : null, "publisherEmail" ,container.Add ); + AddIf( null != (((object)this._publisherName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._publisherName.ToString()) : null, "publisherName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSku.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSku.cs new file mode 100644 index 000000000000..0ff140ed1260 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSku.cs @@ -0,0 +1,375 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes an available ApiManagement SKU. + public partial class ApiManagementSku : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSku, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal + { + + /// Backing field for property. + private string[] _apiVersion; + + /// The api versions that support this SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] ApiVersion { get => this._apiVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities[] _capability; + + /// A name value pair to describe the capability. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities[] Capability { get => this._capability; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacity _capacity; + + /// Specifies the number of virtual machines in the scale set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacity Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuCapacity()); } + + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).Default; } + + /// The maximum capacity that can be set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).Maximum; } + + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).Minimum; } + + /// The scale type applicable to the sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType? CapacityScaleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).ScaleType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts[] _cost; + + /// Metadata for retrieving price info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts[] Cost { get => this._cost; } + + /// Backing field for property. + private string _family; + + /// The Family of this particular SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Family { get => this._family; } + + /// Backing field for property. + private string _kind; + + /// The Kind of resources that are supported in this SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Kind { get => this._kind; } + + /// Backing field for property. + private string[] _location; + + /// The set of locations that the SKU is available. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Location { get => this._location; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo[] _locationInfo; + + /// + /// A list of locations and availability zones in those locations where the SKU is available. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo[] LocationInfo { get => this._locationInfo; } + + /// Internal Acessors for ApiVersion + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.ApiVersion { get => this._apiVersion; set { {_apiVersion = value;} } } + + /// Internal Acessors for Capability + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.Capability { get => this._capability; set { {_capability = value;} } } + + /// Internal Acessors for Capacity + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacity Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuCapacity()); set { {_capacity = value;} } } + + /// Internal Acessors for CapacityDefault + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).Default; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).Default = value; } + + /// Internal Acessors for CapacityMaximum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).Maximum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).Maximum = value; } + + /// Internal Acessors for CapacityMinimum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).Minimum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).Minimum = value; } + + /// Internal Acessors for CapacityScaleType + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.CapacityScaleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).ScaleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal)Capacity).ScaleType = value; } + + /// Internal Acessors for Cost + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.Cost { get => this._cost; set { {_cost = value;} } } + + /// Internal Acessors for Family + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.Family { get => this._family; set { {_family = value;} } } + + /// Internal Acessors for Kind + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for Location + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for LocationInfo + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.LocationInfo { get => this._locationInfo; set { {_locationInfo = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + + /// Internal Acessors for Restriction + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.Restriction { get => this._restriction; set { {_restriction = value;} } } + + /// Internal Acessors for Size + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.Size { get => this._size; set { {_size = value;} } } + + /// Internal Acessors for Tier + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuInternal.Tier { get => this._tier; set { {_tier = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _resourceType; + + /// The type of resource the SKU applies to. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceType { get => this._resourceType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions[] _restriction; + + /// + /// The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions[] Restriction { get => this._restriction; } + + /// Backing field for property. + private string _size; + + /// The Size of the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Size { get => this._size; } + + /// Backing field for property. + private string _tier; + + /// + /// Specifies the tier of virtual machines in a scale set.

Possible Values:

**Standard**

**Basic** + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Tier { get => this._tier; } + + /// Creates an new instance. + public ApiManagementSku() + { + + } + } + /// Describes an available ApiManagement SKU. + public partial interface IApiManagementSku : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The api versions that support this SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The api versions that support this SKU.", + SerializedName = @"apiVersions", + PossibleTypes = new [] { typeof(string) })] + string[] ApiVersion { get; } + /// A name value pair to describe the capability. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A name value pair to describe the capability.", + SerializedName = @"capabilities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities[] Capability { get; } + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The default capacity.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(int) })] + int? CapacityDefault { get; } + /// The maximum capacity that can be set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The maximum capacity that can be set.", + SerializedName = @"maximum", + PossibleTypes = new [] { typeof(int) })] + int? CapacityMaximum { get; } + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The minimum capacity.", + SerializedName = @"minimum", + PossibleTypes = new [] { typeof(int) })] + int? CapacityMinimum { get; } + /// The scale type applicable to the sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The scale type applicable to the sku.", + SerializedName = @"scaleType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType? CapacityScaleType { get; } + /// Metadata for retrieving price info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Metadata for retrieving price info.", + SerializedName = @"costs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts[] Cost { get; } + /// The Family of this particular SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Family of this particular SKU.", + SerializedName = @"family", + PossibleTypes = new [] { typeof(string) })] + string Family { get; } + /// The Kind of resources that are supported in this SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Kind of resources that are supported in this SKU.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; } + /// The set of locations that the SKU is available. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The set of locations that the SKU is available.", + SerializedName = @"locations", + PossibleTypes = new [] { typeof(string) })] + string[] Location { get; } + /// + /// A list of locations and availability zones in those locations where the SKU is available. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of locations and availability zones in those locations where the SKU is available.", + SerializedName = @"locationInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo[] LocationInfo { get; } + /// The name of SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The type of resource the SKU applies to. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of resource the SKU applies to.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// + /// The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.", + SerializedName = @"restrictions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions[] Restriction { get; } + /// The Size of the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Size of the SKU.", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + string Size { get; } + /// + /// Specifies the tier of virtual machines in a scale set.

Possible Values:

**Standard**

**Basic** + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies the tier of virtual machines in a scale set.

Possible Values:

**Standard**

**Basic**", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(string) })] + string Tier { get; } + + } + /// Describes an available ApiManagement SKU. + internal partial interface IApiManagementSkuInternal + + { + /// The api versions that support this SKU. + string[] ApiVersion { get; set; } + /// A name value pair to describe the capability. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities[] Capability { get; set; } + /// Specifies the number of virtual machines in the scale set. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacity Capacity { get; set; } + /// The default capacity. + int? CapacityDefault { get; set; } + /// The maximum capacity that can be set. + int? CapacityMaximum { get; set; } + /// The minimum capacity. + int? CapacityMinimum { get; set; } + /// The scale type applicable to the sku. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType? CapacityScaleType { get; set; } + /// Metadata for retrieving price info. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts[] Cost { get; set; } + /// The Family of this particular SKU. + string Family { get; set; } + /// The Kind of resources that are supported in this SKU. + string Kind { get; set; } + /// The set of locations that the SKU is available. + string[] Location { get; set; } + /// + /// A list of locations and availability zones in those locations where the SKU is available. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo[] LocationInfo { get; set; } + /// The name of SKU. + string Name { get; set; } + /// The type of resource the SKU applies to. + string ResourceType { get; set; } + /// + /// The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions[] Restriction { get; set; } + /// The Size of the SKU. + string Size { get; set; } + /// + /// Specifies the tier of virtual machines in a scale set.

Possible Values:

**Standard**

**Basic** + ///
+ string Tier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSku.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSku.json.cs new file mode 100644 index 000000000000..ec900643c70d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSku.json.cs @@ -0,0 +1,219 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes an available ApiManagement SKU. + public partial class ApiManagementSku + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementSku(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuCapacity.FromJson(__jsonCapacity) : Capacity;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} + {_size = If( json?.PropertyT("size"), out var __jsonSize) ? (string)__jsonSize : (string)Size;} + {_family = If( json?.PropertyT("family"), out var __jsonFamily) ? (string)__jsonFamily : (string)Family;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + {_location = If( json?.PropertyT("locations"), out var __jsonLocations) ? If( __jsonLocations as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Location;} + {_locationInfo = If( json?.PropertyT("locationInfo"), out var __jsonLocationInfo) ? If( __jsonLocationInfo as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuLocationInfo.FromJson(__p) )) ))() : null : LocationInfo;} + {_apiVersion = If( json?.PropertyT("apiVersions"), out var __jsonApiVersions) ? If( __jsonApiVersions as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : ApiVersion;} + {_cost = If( json?.PropertyT("costs"), out var __jsonCosts) ? If( __jsonCosts as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuCosts.FromJson(__f) )) ))() : null : Cost;} + {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? If( __jsonCapabilities as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuCapabilities.FromJson(__a) )) ))() : null : Capability;} + {_restriction = If( json?.PropertyT("restrictions"), out var __jsonRestrictions) ? If( __jsonRestrictions as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuRestrictions.FromJson(___v) )) ))() : null : Restriction;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementSku(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._capacity ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._capacity.ToJson(null,serializationMode) : null, "capacity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._size)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._size.ToString()) : null, "size" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._family)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._family.ToString()) : null, "family" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._location) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._location ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("locations",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._locationInfo) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._locationInfo ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("locationInfo",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._apiVersion) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __n in this._apiVersion ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("apiVersions",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._cost) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __i in this._cost ) + { + AddIf(__i?.ToJson(null, serializationMode) ,__h.Add); + } + container.Add("costs",__h); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._capability) + { + var __c = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __d in this._capability ) + { + AddIf(__d?.ToJson(null, serializationMode) ,__c.Add); + } + container.Add("capabilities",__c); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._restriction) + { + var ___x = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var ___y in this._restriction ) + { + AddIf(___y?.ToJson(null, serializationMode) ,___x.Add); + } + container.Add("restrictions",___x); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapabilities.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapabilities.cs new file mode 100644 index 000000000000..34601f5afc27 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapabilities.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes The SKU capabilities object. + public partial class ApiManagementSkuCapabilities : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilitiesInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilitiesInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilitiesInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _name; + + /// An invariant to describe the feature. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _value; + + /// An invariant if the feature is measured by quantity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; } + + /// Creates an new instance. + public ApiManagementSkuCapabilities() + { + + } + } + /// Describes The SKU capabilities object. + public partial interface IApiManagementSkuCapabilities : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// An invariant to describe the feature. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An invariant to describe the feature.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// An invariant if the feature is measured by quantity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An invariant if the feature is measured by quantity.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; } + + } + /// Describes The SKU capabilities object. + internal partial interface IApiManagementSkuCapabilitiesInternal + + { + /// An invariant to describe the feature. + string Name { get; set; } + /// An invariant if the feature is measured by quantity. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapabilities.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapabilities.json.cs new file mode 100644 index 000000000000..0e2a9d34a09a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapabilities.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes The SKU capabilities object. + public partial class ApiManagementSkuCapabilities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementSkuCapabilities(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementSkuCapabilities(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapacity.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapacity.cs new file mode 100644 index 000000000000..48db97b0cfb0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapacity.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes scaling information of a SKU. + public partial class ApiManagementSkuCapacity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacity, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal + { + + /// Backing field for property. + private int? _default; + + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? Default { get => this._default; } + + /// Backing field for property. + private int? _maximum; + + /// The maximum capacity that can be set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? Maximum { get => this._maximum; } + + /// Internal Acessors for Default + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal.Default { get => this._default; set { {_default = value;} } } + + /// Internal Acessors for Maximum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal.Maximum { get => this._maximum; set { {_maximum = value;} } } + + /// Internal Acessors for Minimum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal.Minimum { get => this._minimum; set { {_minimum = value;} } } + + /// Internal Acessors for ScaleType + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacityInternal.ScaleType { get => this._scaleType; set { {_scaleType = value;} } } + + /// Backing field for property. + private int? _minimum; + + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? Minimum { get => this._minimum; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType? _scaleType; + + /// The scale type applicable to the sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType? ScaleType { get => this._scaleType; } + + /// Creates an new instance. + public ApiManagementSkuCapacity() + { + + } + } + /// Describes scaling information of a SKU. + public partial interface IApiManagementSkuCapacity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The default capacity.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(int) })] + int? Default { get; } + /// The maximum capacity that can be set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The maximum capacity that can be set.", + SerializedName = @"maximum", + PossibleTypes = new [] { typeof(int) })] + int? Maximum { get; } + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The minimum capacity.", + SerializedName = @"minimum", + PossibleTypes = new [] { typeof(int) })] + int? Minimum { get; } + /// The scale type applicable to the sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The scale type applicable to the sku.", + SerializedName = @"scaleType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType? ScaleType { get; } + + } + /// Describes scaling information of a SKU. + internal partial interface IApiManagementSkuCapacityInternal + + { + /// The default capacity. + int? Default { get; set; } + /// The maximum capacity that can be set. + int? Maximum { get; set; } + /// The minimum capacity. + int? Minimum { get; set; } + /// The scale type applicable to the sku. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType? ScaleType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapacity.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapacity.json.cs new file mode 100644 index 000000000000..17fe508d7b20 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCapacity.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes scaling information of a SKU. + public partial class ApiManagementSkuCapacity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementSkuCapacity(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_minimum = If( json?.PropertyT("minimum"), out var __jsonMinimum) ? (int?)__jsonMinimum : Minimum;} + {_maximum = If( json?.PropertyT("maximum"), out var __jsonMaximum) ? (int?)__jsonMaximum : Maximum;} + {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (int?)__jsonDefault : Default;} + {_scaleType = If( json?.PropertyT("scaleType"), out var __jsonScaleType) ? (string)__jsonScaleType : (string)ScaleType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementSkuCapacity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._minimum ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._minimum) : null, "minimum" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._maximum ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._maximum) : null, "maximum" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._default ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._default) : null, "default" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._scaleType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._scaleType.ToString()) : null, "scaleType" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCosts.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCosts.cs new file mode 100644 index 000000000000..749ff19622c5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCosts.cs @@ -0,0 +1,94 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes metadata for retrieving price info. + public partial class ApiManagementSkuCosts : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCostsInternal + { + + /// Backing field for property. + private string _extendedUnit; + + /// An invariant to show the extended unit. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ExtendedUnit { get => this._extendedUnit; } + + /// Backing field for property. + private string _meterId; + + /// Used for querying price from commerce. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Internal Acessors for ExtendedUnit + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCostsInternal.ExtendedUnit { get => this._extendedUnit; set { {_extendedUnit = value;} } } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCostsInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for Quantity + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCostsInternal.Quantity { get => this._quantity; set { {_quantity = value;} } } + + /// Backing field for property. + private long? _quantity; + + /// The multiplier is needed to extend the base metered cost. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Quantity { get => this._quantity; } + + /// Creates an new instance. + public ApiManagementSkuCosts() + { + + } + } + /// Describes metadata for retrieving price info. + public partial interface IApiManagementSkuCosts : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// An invariant to show the extended unit. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An invariant to show the extended unit.", + SerializedName = @"extendedUnit", + PossibleTypes = new [] { typeof(string) })] + string ExtendedUnit { get; } + /// Used for querying price from commerce. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Used for querying price from commerce.", + SerializedName = @"meterID", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// The multiplier is needed to extend the base metered cost. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The multiplier is needed to extend the base metered cost.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(long) })] + long? Quantity { get; } + + } + /// Describes metadata for retrieving price info. + internal partial interface IApiManagementSkuCostsInternal + + { + /// An invariant to show the extended unit. + string ExtendedUnit { get; set; } + /// Used for querying price from commerce. + string MeterId { get; set; } + /// The multiplier is needed to extend the base metered cost. + long? Quantity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCosts.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCosts.json.cs new file mode 100644 index 000000000000..78fa77ac5340 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuCosts.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes metadata for retrieving price info. + public partial class ApiManagementSkuCosts + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementSkuCosts(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_meterId = If( json?.PropertyT("meterID"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (long?)__jsonQuantity : Quantity;} + {_extendedUnit = If( json?.PropertyT("extendedUnit"), out var __jsonExtendedUnit) ? (string)__jsonExtendedUnit : (string)ExtendedUnit;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCosts FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementSkuCosts(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._meterId.ToString()) : null, "meterID" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._quantity ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._quantity) : null, "quantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._extendedUnit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._extendedUnit.ToString()) : null, "extendedUnit" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuLocationInfo.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuLocationInfo.cs new file mode 100644 index 000000000000..4b50f9f2acd2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuLocationInfo.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementSkuLocationInfo : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfoInternal + { + + /// Backing field for property. + private string _location; + + /// Location of the SKU + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfoInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for Zone + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfoInternal.Zone { get => this._zone; set { {_zone = value;} } } + + /// Internal Acessors for ZoneDetail + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfoInternal.ZoneDetail { get => this._zoneDetail; set { {_zoneDetail = value;} } } + + /// Backing field for property. + private string[] _zone; + + /// List of availability zones where the SKU is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Zone { get => this._zone; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails[] _zoneDetail; + + /// Details of capabilities available to a SKU in specific zones. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails[] ZoneDetail { get => this._zoneDetail; } + + /// Creates an new instance. + public ApiManagementSkuLocationInfo() + { + + } + } + public partial interface IApiManagementSkuLocationInfo : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Location of the SKU + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Location of the SKU", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; } + /// List of availability zones where the SKU is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of availability zones where the SKU is supported.", + SerializedName = @"zones", + PossibleTypes = new [] { typeof(string) })] + string[] Zone { get; } + /// Details of capabilities available to a SKU in specific zones. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Details of capabilities available to a SKU in specific zones.", + SerializedName = @"zoneDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails[] ZoneDetail { get; } + + } + internal partial interface IApiManagementSkuLocationInfoInternal + + { + /// Location of the SKU + string Location { get; set; } + /// List of availability zones where the SKU is supported. + string[] Zone { get; set; } + /// Details of capabilities available to a SKU in specific zones. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails[] ZoneDetail { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuLocationInfo.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuLocationInfo.json.cs new file mode 100644 index 000000000000..2cff3523e3a0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuLocationInfo.json.cs @@ -0,0 +1,136 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementSkuLocationInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementSkuLocationInfo(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Zone;} + {_zoneDetail = If( json?.PropertyT("zoneDetails"), out var __jsonZoneDetails) ? If( __jsonZoneDetails as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuZoneDetails.FromJson(__p) )) ))() : null : ZoneDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuLocationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementSkuLocationInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._zone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._zone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("zones",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._zoneDetail) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._zoneDetail ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("zoneDetails",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictionInfo.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictionInfo.cs new file mode 100644 index 000000000000..9f63070e4526 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictionInfo.cs @@ -0,0 +1,71 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementSkuRestrictionInfo : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfo, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfoInternal + { + + /// Backing field for property. + private string[] _location; + + /// Locations where the SKU is restricted + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Location { get => this._location; } + + /// Internal Acessors for Location + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfoInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for Zone + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfoInternal.Zone { get => this._zone; set { {_zone = value;} } } + + /// Backing field for property. + private string[] _zone; + + /// List of availability zones where the SKU is restricted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Zone { get => this._zone; } + + /// Creates an new instance. + public ApiManagementSkuRestrictionInfo() + { + + } + } + public partial interface IApiManagementSkuRestrictionInfo : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Locations where the SKU is restricted + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Locations where the SKU is restricted", + SerializedName = @"locations", + PossibleTypes = new [] { typeof(string) })] + string[] Location { get; } + /// List of availability zones where the SKU is restricted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of availability zones where the SKU is restricted.", + SerializedName = @"zones", + PossibleTypes = new [] { typeof(string) })] + string[] Zone { get; } + + } + internal partial interface IApiManagementSkuRestrictionInfoInternal + + { + /// Locations where the SKU is restricted + string[] Location { get; set; } + /// List of availability zones where the SKU is restricted. + string[] Zone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictionInfo.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictionInfo.json.cs new file mode 100644 index 000000000000..6eb07522c618 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictionInfo.json.cs @@ -0,0 +1,131 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementSkuRestrictionInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementSkuRestrictionInfo(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_location = If( json?.PropertyT("locations"), out var __jsonLocations) ? If( __jsonLocations as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Location;} + {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : Zone;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementSkuRestrictionInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._location) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._location ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("locations",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._zone) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._zone ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("zones",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictions.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictions.cs new file mode 100644 index 000000000000..9faf9884cf0b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictions.cs @@ -0,0 +1,149 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes scaling information of a SKU. + public partial class ApiManagementSkuRestrictions : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionsInternal + { + + /// Internal Acessors for ReasonCode + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionsInternal.ReasonCode { get => this._reasonCode; set { {_reasonCode = value;} } } + + /// Internal Acessors for RestrictionInfo + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfo Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionsInternal.RestrictionInfo { get => (this._restrictionInfo = this._restrictionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuRestrictionInfo()); set { {_restrictionInfo = value;} } } + + /// Internal Acessors for RestrictionInfoLocation + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionsInternal.RestrictionInfoLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfoInternal)RestrictionInfo).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfoInternal)RestrictionInfo).Location = value; } + + /// Internal Acessors for RestrictionInfoZone + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionsInternal.RestrictionInfoZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfoInternal)RestrictionInfo).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfoInternal)RestrictionInfo).Zone = value; } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionsInternal.Type { get => this._type; set { {_type = value;} } } + + /// Internal Acessors for Value + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionsInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode? _reasonCode; + + /// The reason for restriction. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode? ReasonCode { get => this._reasonCode; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfo _restrictionInfo; + + /// The information about the restriction where the SKU cannot be used. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfo RestrictionInfo { get => (this._restrictionInfo = this._restrictionInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuRestrictionInfo()); } + + /// Locations where the SKU is restricted + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] RestrictionInfoLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfoInternal)RestrictionInfo).Location; } + + /// List of availability zones where the SKU is restricted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] RestrictionInfoZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfoInternal)RestrictionInfo).Zone; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType? _type; + + /// The type of restrictions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType? Type { get => this._type; } + + /// Backing field for property. + private string[] _value; + + /// + /// The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU + /// is restricted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Value { get => this._value; } + + /// Creates an new instance. + public ApiManagementSkuRestrictions() + { + + } + } + /// Describes scaling information of a SKU. + public partial interface IApiManagementSkuRestrictions : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The reason for restriction. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The reason for restriction.", + SerializedName = @"reasonCode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode? ReasonCode { get; } + /// Locations where the SKU is restricted + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Locations where the SKU is restricted", + SerializedName = @"locations", + PossibleTypes = new [] { typeof(string) })] + string[] RestrictionInfoLocation { get; } + /// List of availability zones where the SKU is restricted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of availability zones where the SKU is restricted.", + SerializedName = @"zones", + PossibleTypes = new [] { typeof(string) })] + string[] RestrictionInfoZone { get; } + /// The type of restrictions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of restrictions.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType? Type { get; } + /// + /// The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU + /// is restricted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; } + + } + /// Describes scaling information of a SKU. + internal partial interface IApiManagementSkuRestrictionsInternal + + { + /// The reason for restriction. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode? ReasonCode { get; set; } + /// The information about the restriction where the SKU cannot be used. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictionInfo RestrictionInfo { get; set; } + /// Locations where the SKU is restricted + string[] RestrictionInfoLocation { get; set; } + /// List of availability zones where the SKU is restricted. + string[] RestrictionInfoZone { get; set; } + /// The type of restrictions. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType? Type { get; set; } + /// + /// The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU + /// is restricted. + /// + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictions.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictions.json.cs new file mode 100644 index 000000000000..c4b257d0814f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuRestrictions.json.cs @@ -0,0 +1,134 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes scaling information of a SKU. + public partial class ApiManagementSkuRestrictions + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementSkuRestrictions(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_restrictionInfo = If( json?.PropertyT("restrictionInfo"), out var __jsonRestrictionInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuRestrictionInfo.FromJson(__jsonRestrictionInfo) : RestrictionInfo;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + {_reasonCode = If( json?.PropertyT("reasonCode"), out var __jsonReasonCode) ? (string)__jsonReasonCode : (string)ReasonCode;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuRestrictions FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementSkuRestrictions(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._restrictionInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._restrictionInfo.ToJson(null,serializationMode) : null, "restrictionInfo" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reasonCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._reasonCode.ToString()) : null, "reasonCode" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuZoneDetails.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuZoneDetails.cs new file mode 100644 index 000000000000..6c55da19c072 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuZoneDetails.cs @@ -0,0 +1,80 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes The zonal capabilities of a SKU. + public partial class ApiManagementSkuZoneDetails : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetailsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities[] _capability; + + /// + /// A list of capabilities that are available for the SKU in the specified list of zones. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities[] Capability { get => this._capability; } + + /// Internal Acessors for Capability + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetailsInternal.Capability { get => this._capability; set { {_capability = value;} } } + + /// Internal Acessors for Name + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetailsInternal.Name { get => this._name; set { {_name = value;} } } + + /// Backing field for property. + private string[] _name; + + /// The set of zones that the SKU is available in with the specified capabilities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Name { get => this._name; } + + /// Creates an new instance. + public ApiManagementSkuZoneDetails() + { + + } + } + /// Describes The zonal capabilities of a SKU. + public partial interface IApiManagementSkuZoneDetails : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// A list of capabilities that are available for the SKU in the specified list of zones. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of capabilities that are available for the SKU in the specified list of zones.", + SerializedName = @"capabilities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities[] Capability { get; } + /// The set of zones that the SKU is available in with the specified capabilities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The set of zones that the SKU is available in with the specified capabilities.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string[] Name { get; } + + } + /// Describes The zonal capabilities of a SKU. + internal partial interface IApiManagementSkuZoneDetailsInternal + + { + /// + /// A list of capabilities that are available for the SKU in the specified list of zones. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities[] Capability { get; set; } + /// The set of zones that the SKU is available in with the specified capabilities. + string[] Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuZoneDetails.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuZoneDetails.json.cs new file mode 100644 index 000000000000..35806a7c7b64 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkuZoneDetails.json.cs @@ -0,0 +1,132 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes The zonal capabilities of a SKU. + public partial class ApiManagementSkuZoneDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementSkuZoneDetails(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? If( __jsonName as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Name;} + {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? If( __jsonCapabilities as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuCapabilities) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSkuCapabilities.FromJson(__p) )) ))() : null : Capability;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkuZoneDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementSkuZoneDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._name) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._name ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("name",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._capability) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._capability ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("capabilities",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkusResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkusResult.cs new file mode 100644 index 000000000000..f37d7724c3b9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkusResult.cs @@ -0,0 +1,77 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The List Resource Skus operation response. + public partial class ApiManagementSkusResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkusResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkusResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkusResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// + /// The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSku[] _value; + + /// The list of skus available for the subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSku[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ApiManagementSkusResult() + { + + } + } + /// The List Resource Skus operation response. + public partial interface IApiManagementSkusResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of skus available for the subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of skus available for the subscription.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSku) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSku[] Value { get; set; } + + } + /// The List Resource Skus operation response. + internal partial interface IApiManagementSkusResultInternal + + { + /// + /// The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus + /// + string NextLink { get; set; } + /// The list of skus available for the subscription. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSku[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkusResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkusResult.json.cs new file mode 100644 index 000000000000..05cddd95dd1a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiManagementSkusResult.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The List Resource Skus operation response. + public partial class ApiManagementSkusResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementSkusResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSku) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiManagementSku.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkusResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkusResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiManagementSkusResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementSkusResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseCollection.cs new file mode 100644 index 000000000000..6f9678995f5b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged ApiRelease list representation. + public partial class ApiReleaseCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract[] Value { get => this._value; } + + /// Creates an new instance. + public ApiReleaseCollection() + { + + } + } + /// Paged ApiRelease list representation. + public partial interface IApiReleaseCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract[] Value { get; } + + } + /// Paged ApiRelease list representation. + internal partial interface IApiReleaseCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseCollection.json.cs new file mode 100644 index 000000000000..bc858f2d2832 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged ApiRelease list representation. + public partial class ApiReleaseCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiReleaseCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiReleaseCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContract.cs new file mode 100644 index 000000000000..2d881ef1c28f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContract.cs @@ -0,0 +1,186 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// ApiRelease details. + public partial class ApiReleaseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Identifier of the API the release belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal)Property).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal)Property).ApiId = value ?? null; } + + /// + /// The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal)Property).CreatedDateTime; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for CreatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractInternal.CreatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal)Property).CreatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal)Property).CreatedDateTime = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for UpdatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractInternal.UpdatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal)Property).UpdatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal)Property).UpdatedDateTime = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Release Notes + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Note { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal)Property).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal)Property).Note = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractProperties _property; + + /// ApiRelease entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// The time the API release was updated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? UpdatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal)Property).UpdatedDateTime; } + + /// Creates an new instance. + public ApiReleaseContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// ApiRelease details. + public partial interface IApiReleaseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Identifier of the API the release belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the API the release belongs to.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + /// + /// The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.", + SerializedName = @"createdDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDateTime { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Release Notes + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Release Notes", + SerializedName = @"notes", + PossibleTypes = new [] { typeof(string) })] + string Note { get; set; } + /// The time the API release was updated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time the API release was updated.", + SerializedName = @"updatedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UpdatedDateTime { get; } + + } + /// ApiRelease details. + internal partial interface IApiReleaseContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Identifier of the API the release belongs to. + string ApiId { get; set; } + /// + /// The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? CreatedDateTime { get; set; } + + string ETag { get; set; } + /// Release Notes + string Note { get; set; } + /// ApiRelease entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractProperties Property { get; set; } + /// The time the API release was updated. + global::System.DateTime? UpdatedDateTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContract.json.cs new file mode 100644 index 000000000000..a29fb08b9c55 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// ApiRelease details. + public partial class ApiReleaseContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiReleaseContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiReleaseContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiReleaseContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContractProperties.cs new file mode 100644 index 000000000000..b7c6ff25ff5d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContractProperties.cs @@ -0,0 +1,117 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Release details + public partial class ApiReleaseContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal + { + + /// Backing field for property. + private string _apiId; + + /// Identifier of the API the release belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiId { get => this._apiId; set => this._apiId = value; } + + /// Backing field for property. + private global::System.DateTime? _createdDateTime; + + /// + /// The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedDateTime { get => this._createdDateTime; } + + /// Internal Acessors for CreatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal.CreatedDateTime { get => this._createdDateTime; set { {_createdDateTime = value;} } } + + /// Internal Acessors for UpdatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractPropertiesInternal.UpdatedDateTime { get => this._updatedDateTime; set { {_updatedDateTime = value;} } } + + /// Backing field for property. + private string _note; + + /// Release Notes + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Note { get => this._note; set => this._note = value; } + + /// Backing field for property. + private global::System.DateTime? _updatedDateTime; + + /// The time the API release was updated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? UpdatedDateTime { get => this._updatedDateTime; } + + /// Creates an new instance. + public ApiReleaseContractProperties() + { + + } + } + /// API Release details + public partial interface IApiReleaseContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Identifier of the API the release belongs to. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the API the release belongs to.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + /// + /// The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.", + SerializedName = @"createdDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDateTime { get; } + /// Release Notes + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Release Notes", + SerializedName = @"notes", + PossibleTypes = new [] { typeof(string) })] + string Note { get; set; } + /// The time the API release was updated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time the API release was updated.", + SerializedName = @"updatedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UpdatedDateTime { get; } + + } + /// API Release details + internal partial interface IApiReleaseContractPropertiesInternal + + { + /// Identifier of the API the release belongs to. + string ApiId { get; set; } + /// + /// The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? CreatedDateTime { get; set; } + /// Release Notes + string Note { get; set; } + /// The time the API release was updated. + global::System.DateTime? UpdatedDateTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContractProperties.json.cs new file mode 100644 index 000000000000..a4d866e82bfb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiReleaseContractProperties.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Release details + public partial class ApiReleaseContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiReleaseContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_apiId = If( json?.PropertyT("apiId"), out var __jsonApiId) ? (string)__jsonApiId : (string)ApiId;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} + {_updatedDateTime = If( json?.PropertyT("updatedDateTime"), out var __jsonUpdatedDateTime) ? global::System.DateTime.TryParse((string)__jsonUpdatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedDateTimeValue) ? __jsonUpdatedDateTimeValue : UpdatedDateTime : UpdatedDateTime;} + {_note = If( json?.PropertyT("notes"), out var __jsonNotes) ? (string)__jsonNotes : (string)Note;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiReleaseContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiReleaseContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._apiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiId.ToString()) : null, "apiId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._createdDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._createdDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdDateTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._updatedDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._updatedDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "updatedDateTime" ,container.Add ); + } + AddIf( null != (((object)this._note)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._note.ToString()) : null, "notes" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionCollection.cs new file mode 100644 index 000000000000..31f606e8dea2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged API Revision list representation. + public partial class ApiRevisionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract[] Value { get => this._value; } + + /// Creates an new instance. + public ApiRevisionCollection() + { + + } + } + /// Paged API Revision list representation. + public partial interface IApiRevisionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract[] Value { get; } + + } + /// Paged API Revision list representation. + internal partial interface IApiRevisionCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionCollection.json.cs new file mode 100644 index 000000000000..d6577d1d323e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged API Revision list representation. + public partial class ApiRevisionCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiRevisionCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiRevisionContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiRevisionCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionContract.cs new file mode 100644 index 000000000000..71eb5d3bbef9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionContract.cs @@ -0,0 +1,212 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Summary of revision metadata. + public partial class ApiRevisionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContractInternal + { + + /// Backing field for property. + private string _apiId; + + /// Identifier of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiId { get => this._apiId; } + + /// Backing field for property. + private string _apiRevision; + + /// Revision number of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiRevision { get => this._apiRevision; } + + /// Backing field for property. + private global::System.DateTime? _createdDateTime; + + /// + /// The time the API Revision was created. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedDateTime { get => this._createdDateTime; } + + /// Backing field for property. + private string _description; + + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Backing field for property. + private bool? _isCurrent; + + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsCurrent { get => this._isCurrent; } + + /// Backing field for property. + private bool? _isOnline; + + /// Indicates if API revision is the current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsOnline { get => this._isOnline; } + + /// Internal Acessors for ApiId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContractInternal.ApiId { get => this._apiId; set { {_apiId = value;} } } + + /// Internal Acessors for ApiRevision + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContractInternal.ApiRevision { get => this._apiRevision; set { {_apiRevision = value;} } } + + /// Internal Acessors for CreatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContractInternal.CreatedDateTime { get => this._createdDateTime; set { {_createdDateTime = value;} } } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContractInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for IsCurrent + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContractInternal.IsCurrent { get => this._isCurrent; set { {_isCurrent = value;} } } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContractInternal.IsOnline { get => this._isOnline; set { {_isOnline = value;} } } + + /// Internal Acessors for PrivateUrl + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContractInternal.PrivateUrl { get => this._privateUrl; set { {_privateUrl = value;} } } + + /// Internal Acessors for UpdatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContractInternal.UpdatedDateTime { get => this._updatedDateTime; set { {_updatedDateTime = value;} } } + + /// Backing field for property. + private string _privateUrl; + + /// Gateway URL for accessing the non-current API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrivateUrl { get => this._privateUrl; } + + /// Backing field for property. + private global::System.DateTime? _updatedDateTime; + + /// + /// The time the API Revision were updated. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? UpdatedDateTime { get => this._updatedDateTime; } + + /// Creates an new instance. + public ApiRevisionContract() + { + + } + } + /// Summary of revision metadata. + public partial interface IApiRevisionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Identifier of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier of the API Revision.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; } + /// Revision number of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Revision number of API.", + SerializedName = @"apiRevision", + PossibleTypes = new [] { typeof(string) })] + string ApiRevision { get; } + /// + /// The time the API Revision was created. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time the API Revision was created. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.", + SerializedName = @"createdDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDateTime { get; } + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Description of the API Revision.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if API revision is accessible via the gateway.", + SerializedName = @"isCurrent", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCurrent { get; } + /// Indicates if API revision is the current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if API revision is the current api revision.", + SerializedName = @"isOnline", + PossibleTypes = new [] { typeof(bool) })] + bool? IsOnline { get; } + /// Gateway URL for accessing the non-current API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gateway URL for accessing the non-current API Revision.", + SerializedName = @"privateUrl", + PossibleTypes = new [] { typeof(string) })] + string PrivateUrl { get; } + /// + /// The time the API Revision were updated. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time the API Revision were updated. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.", + SerializedName = @"updatedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UpdatedDateTime { get; } + + } + /// Summary of revision metadata. + internal partial interface IApiRevisionContractInternal + + { + /// Identifier of the API Revision. + string ApiId { get; set; } + /// Revision number of API. + string ApiRevision { get; set; } + /// + /// The time the API Revision was created. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by + /// the ISO 8601 standard. + /// + global::System.DateTime? CreatedDateTime { get; set; } + /// Description of the API Revision. + string Description { get; set; } + /// Indicates if API revision is accessible via the gateway. + bool? IsCurrent { get; set; } + /// Indicates if API revision is the current api revision. + bool? IsOnline { get; set; } + /// Gateway URL for accessing the non-current API Revision. + string PrivateUrl { get; set; } + /// + /// The time the API Revision were updated. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by + /// the ISO 8601 standard. + /// + global::System.DateTime? UpdatedDateTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionContract.json.cs new file mode 100644 index 000000000000..1fa487270726 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionContract.json.cs @@ -0,0 +1,146 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Summary of revision metadata. + public partial class ApiRevisionContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiRevisionContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_apiId = If( json?.PropertyT("apiId"), out var __jsonApiId) ? (string)__jsonApiId : (string)ApiId;} + {_apiRevision = If( json?.PropertyT("apiRevision"), out var __jsonApiRevision) ? (string)__jsonApiRevision : (string)ApiRevision;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} + {_updatedDateTime = If( json?.PropertyT("updatedDateTime"), out var __jsonUpdatedDateTime) ? global::System.DateTime.TryParse((string)__jsonUpdatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedDateTimeValue) ? __jsonUpdatedDateTimeValue : UpdatedDateTime : UpdatedDateTime;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_privateUrl = If( json?.PropertyT("privateUrl"), out var __jsonPrivateUrl) ? (string)__jsonPrivateUrl : (string)PrivateUrl;} + {_isOnline = If( json?.PropertyT("isOnline"), out var __jsonIsOnline) ? (bool?)__jsonIsOnline : IsOnline;} + {_isCurrent = If( json?.PropertyT("isCurrent"), out var __jsonIsCurrent) ? (bool?)__jsonIsCurrent : IsCurrent;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiRevisionContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._apiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiId.ToString()) : null, "apiId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._apiRevision)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiRevision.ToString()) : null, "apiRevision" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._createdDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._createdDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdDateTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._updatedDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._updatedDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "updatedDateTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._privateUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._privateUrl.ToString()) : null, "privateUrl" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isOnline ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isOnline) : null, "isOnline" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isCurrent ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isCurrent) : null, "isCurrent" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionInfoContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionInfoContract.cs new file mode 100644 index 000000000000..3b775d708725 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionInfoContract.cs @@ -0,0 +1,207 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Object used to create an API Revision or Version based on an existing API Revision + /// + public partial class ApiRevisionInfoContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionInfoContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionInfoContractInternal + { + + /// Backing field for property. + private string _apiRevisionDescription; + + /// Description of new API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiRevisionDescription { get => this._apiRevisionDescription; set => this._apiRevisionDescription = value; } + + /// Backing field for property. + private string _apiVersionName; + + /// Version identifier for the new API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiVersionName { get => this._apiVersionName; set => this._apiVersionName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails _apiVersionSet; + + /// Version set details + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails ApiVersionSet { get => (this._apiVersionSet = this._apiVersionSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContractDetails()); set => this._apiVersionSet = value; } + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Description = value ?? null; } + + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Id = value ?? null; } + + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).Name = value ?? null; } + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetVersionHeaderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionHeaderName = value ?? null; } + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetVersionQueryName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersionQueryName = value ?? null; } + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal)ApiVersionSet).VersioningScheme = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme)""); } + + /// Internal Acessors for ApiVersionSet + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionInfoContractInternal.ApiVersionSet { get => (this._apiVersionSet = this._apiVersionSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContractDetails()); set { {_apiVersionSet = value;} } } + + /// Backing field for property. + private string _sourceApiId; + + /// Resource identifier of API to be used to create the revision from. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SourceApiId { get => this._sourceApiId; set => this._sourceApiId = value; } + + /// Creates an new instance. + public ApiRevisionInfoContract() + { + + } + } + /// Object used to create an API Revision or Version based on an existing API Revision + public partial interface IApiRevisionInfoContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of new API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of new API Revision.", + SerializedName = @"apiRevisionDescription", + PossibleTypes = new [] { typeof(string) })] + string ApiRevisionDescription { get; set; } + /// Version identifier for the new API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version identifier for the new API Version.", + SerializedName = @"apiVersionName", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionName { get; set; } + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of API Version Set.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetDescription { get; set; } + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier for existing API Version Set. Omit this value to create a new Version Set.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetId { get; set; } + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The display Name of the API Version Set.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetName { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.", + SerializedName = @"versionHeaderName", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetVersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of query parameter that indicates the API Version if versioningScheme is set to `query`.", + SerializedName = @"versionQueryName", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetVersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An value that determines where the API Version identifier will be located in a HTTP request.", + SerializedName = @"versioningScheme", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get; set; } + /// Resource identifier of API to be used to create the revision from. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identifier of API to be used to create the revision from.", + SerializedName = @"sourceApiId", + PossibleTypes = new [] { typeof(string) })] + string SourceApiId { get; set; } + + } + /// Object used to create an API Revision or Version based on an existing API Revision + internal partial interface IApiRevisionInfoContractInternal + + { + /// Description of new API Revision. + string ApiRevisionDescription { get; set; } + /// Version identifier for the new API Version. + string ApiVersionName { get; set; } + /// Version set details + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails ApiVersionSet { get; set; } + /// Description of API Version Set. + string ApiVersionSetDescription { get; set; } + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + string ApiVersionSetId { get; set; } + /// The display Name of the API Version Set. + string ApiVersionSetName { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + string ApiVersionSetVersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + string ApiVersionSetVersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? ApiVersionSetVersioningScheme { get; set; } + /// Resource identifier of API to be used to create the revision from. + string SourceApiId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionInfoContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionInfoContract.json.cs new file mode 100644 index 000000000000..845fd033ee2e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiRevisionInfoContract.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Object used to create an API Revision or Version based on an existing API Revision + /// + public partial class ApiRevisionInfoContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiRevisionInfoContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_apiVersionSet = If( json?.PropertyT("apiVersionSet"), out var __jsonApiVersionSet) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContractDetails.FromJson(__jsonApiVersionSet) : ApiVersionSet;} + {_sourceApiId = If( json?.PropertyT("sourceApiId"), out var __jsonSourceApiId) ? (string)__jsonSourceApiId : (string)SourceApiId;} + {_apiVersionName = If( json?.PropertyT("apiVersionName"), out var __jsonApiVersionName) ? (string)__jsonApiVersionName : (string)ApiVersionName;} + {_apiRevisionDescription = If( json?.PropertyT("apiRevisionDescription"), out var __jsonApiRevisionDescription) ? (string)__jsonApiRevisionDescription : (string)ApiRevisionDescription;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionInfoContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionInfoContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiRevisionInfoContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiRevisionInfoContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._apiVersionSet ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._apiVersionSet.ToJson(null,serializationMode) : null, "apiVersionSet" ,container.Add ); + AddIf( null != (((object)this._sourceApiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._sourceApiId.ToString()) : null, "sourceApiId" ,container.Add ); + AddIf( null != (((object)this._apiVersionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiVersionName.ToString()) : null, "apiVersionName" ,container.Add ); + AddIf( null != (((object)this._apiRevisionDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiRevisionDescription.ToString()) : null, "apiRevisionDescription" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiTagResourceContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiTagResourceContractProperties.cs new file mode 100644 index 000000000000..046b6218f857 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiTagResourceContractProperties.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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API contract properties for the Tag Resources. + public partial class ApiTagResourceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiTagResourceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiTagResourceContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContract __apiEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiEntityBaseContract(); + + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevision = value ?? null; } + + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiRevisionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiRevisionDescription = value ?? null; } + + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType)""); } + + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersion = value ?? null; } + + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionDescription = value ?? null; } + + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiVersionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ApiVersionSetId = value ?? null; } + + /// Collection of authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSetting = value ?? null /* model class */; } + + /// OAuth2 Authentication settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2 = value ?? null /* model class */; } + + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOAuth2AuthenticationSetting = value ?? null /* arrayOf */; } + + /// OpenID Connect Authentication Settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenid = value ?? null /* model class */; } + + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).AuthenticationSettingOpenidAuthenticationSetting = value ?? null /* arrayOf */; } + + /// Contact information for the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Contact = value ?? null /* model class */; } + + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactEmail = value ?? null; } + + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactName = value ?? null; } + + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ContactUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).ContactUrl = value ?? null; } + + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).Description = value ?? null; } + + /// Backing field for property. + private string _id; + + /// API identifier in the form /apis/{apiId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? IsCurrent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsCurrent = value ?? default(bool); } + + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline; } + + /// License information for the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).License = value ?? null /* model class */; } + + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string LicenseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseName = value ?? null; } + + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string LicenseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).LicenseUrl = value ?? null; } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).IsOnline = value; } + + /// Backing field for property. + private string _name; + + /// API name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OAuth2AuthorizationServerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2AuthorizationServerId = value ?? null; } + + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OAuth2Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OAuth2Scope = value ?? null; } + + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidBearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string OpenidProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).OpenidProviderId = value ?? null; } + + /// Backing field for property. + private string _path; + + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Path { get => this._path; set => this._path = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] _protocol; + + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get => this._protocol; set => this._protocol = value; } + + /// Backing field for property. + private string _serviceUrl; + + /// Absolute URL of the backend service implementing this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ServiceUrl { get => this._serviceUrl; set => this._serviceUrl = value; } + + /// Protocols over which API is made available. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterName = value ?? null /* model class */; } + + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SubscriptionKeyParameterNameHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameHeader = value ?? null; } + + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SubscriptionKeyParameterNameQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionKeyParameterNameQuery = value ?? null; } + + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).SubscriptionRequired = value ?? default(bool); } + + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string TermsOfServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)__apiEntityBaseContract).TermsOfServiceUrl = value ?? null; } + + /// Creates an new instance. + public ApiTagResourceContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__apiEntityBaseContract), __apiEntityBaseContract); + await eventListener.AssertObjectIsValid(nameof(__apiEntityBaseContract), __apiEntityBaseContract); + } + } + /// API contract properties for the Tag Resources. + public partial interface IApiTagResourceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContract + { + /// API identifier in the form /apis/{apiId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API identifier in the form /apis/{apiId}.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// API name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes on which protocols the operations in this API can be invoked.", + SerializedName = @"protocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// Absolute URL of the backend service implementing this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Absolute URL of the backend service implementing this API.", + SerializedName = @"serviceUrl", + PossibleTypes = new [] { typeof(string) })] + string ServiceUrl { get; set; } + + } + /// API contract properties for the Tag Resources. + internal partial interface IApiTagResourceContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal + { + /// API identifier in the form /apis/{apiId}. + string Id { get; set; } + /// API name. + string Name { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + string Path { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// Absolute URL of the backend service implementing this API. + string ServiceUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiTagResourceContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiTagResourceContractProperties.json.cs new file mode 100644 index 000000000000..9fdfcc4a395a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiTagResourceContractProperties.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API contract properties for the Tag Resources. + public partial class ApiTagResourceContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiTagResourceContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __apiEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiEntityBaseContract(json); + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_serviceUrl = If( json?.PropertyT("serviceUrl"), out var __jsonServiceUrl) ? (string)__jsonServiceUrl : (string)ServiceUrl;} + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + {_protocol = If( json?.PropertyT("protocols"), out var __jsonProtocols) ? If( __jsonProtocols as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol)""))) ))() : null : Protocol;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiTagResourceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiTagResourceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiTagResourceContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiTagResourceContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __apiEntityBaseContract?.ToJson(container, serializationMode); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._serviceUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._serviceUrl.ToString()) : null, "serviceUrl" ,container.Add ); + AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); + if (null != this._protocol) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._protocol ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("protocols",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiUpdateContract.cs new file mode 100644 index 000000000000..7b6e056f0242 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiUpdateContract.cs @@ -0,0 +1,501 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API update contract details. + public partial class ApiUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContractInternal + { + + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevision = value ?? null; } + + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiRevisionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevisionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiRevisionDescription = value ?? null; } + + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType)""); } + + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersion = value ?? null; } + + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionDescription = value ?? null; } + + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiVersionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ApiVersionSetId = value ?? null; } + + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2AuthenticationSetting = value ?? null /* arrayOf */; } + + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenidAuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenidAuthenticationSetting = value ?? null /* arrayOf */; } + + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactEmail = value ?? null; } + + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactName = value ?? null; } + + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContactUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).ContactUrl = value ?? null; } + + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Description = value ?? null; } + + /// API name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdatePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdatePropertiesInternal)Property).DisplayName = value ?? null; } + + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsCurrent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsCurrent = value ?? default(bool); } + + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsOnline; } + + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LicenseName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseName = value ?? null; } + + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LicenseUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).LicenseUrl = value ?? null; } + + /// Internal Acessors for AuthenticationSetting + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContractInternal.AuthenticationSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSetting = value; } + + /// Internal Acessors for AuthenticationSettingOAuth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContractInternal.AuthenticationSettingOAuth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOAuth2 = value; } + + /// Internal Acessors for AuthenticationSettingOpenid + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContractInternal.AuthenticationSettingOpenid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).AuthenticationSettingOpenid = value; } + + /// Internal Acessors for Contact + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContractInternal.Contact { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Contact; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).Contact = value; } + + /// Internal Acessors for IsOnline + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContractInternal.IsOnline { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsOnline; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).IsOnline = value; } + + /// Internal Acessors for License + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContractInternal.License { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).License; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).License = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContractUpdateProperties()); set { {_property = value;} } } + + /// Internal Acessors for SubscriptionKeyParameterName + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContractInternal.SubscriptionKeyParameterName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterName = value; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OAuth2AuthorizationServerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2AuthorizationServerId = value ?? null; } + + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OAuth2Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OAuth2Scope = value ?? null; } + + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidBearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidBearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OpenidProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).OpenidProviderId = value ?? null; } + + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Path { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdatePropertiesInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdatePropertiesInternal)Property).Path = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdateProperties _property; + + /// Properties of the API entity that can be updated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContractUpdateProperties()); set => this._property = value; } + + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdatePropertiesInternal)Property).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdatePropertiesInternal)Property).Protocol = value ?? null /* arrayOf */; } + + /// Absolute URL of the backend service implementing this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdatePropertiesInternal)Property).ServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdatePropertiesInternal)Property).ServiceUrl = value ?? null; } + + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SubscriptionKeyParameterNameHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameHeader = value ?? null; } + + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SubscriptionKeyParameterNameQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionKeyParameterNameQuery = value ?? null; } + + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).SubscriptionRequired = value ?? default(bool); } + + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TermsOfServiceUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).TermsOfServiceUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiEntityBaseContractInternal)Property).TermsOfServiceUrl = value ?? null; } + + /// Creates an new instance. + public ApiUpdateContract() + { + + } + } + /// API update contract details. + public partial interface IApiUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes the revision of the API. If no value is provided, default revision 1 is created", + SerializedName = @"apiRevision", + PossibleTypes = new [] { typeof(string) })] + string ApiRevision { get; set; } + /// Description of the API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API Revision.", + SerializedName = @"apiRevisionDescription", + PossibleTypes = new [] { typeof(string) })] + string ApiRevisionDescription { get; set; } + /// Type of API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of API.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get; set; } + /// Indicates the version identifier of the API if the API is versioned + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the version identifier of the API if the API is versioned", + SerializedName = @"apiVersion", + PossibleTypes = new [] { typeof(string) })] + string ApiVersion { get; set; } + /// Description of the API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API Version.", + SerializedName = @"apiVersionDescription", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionDescription { get; set; } + /// A resource identifier for the related ApiVersionSet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the related ApiVersionSet.", + SerializedName = @"apiVersionSetId", + PossibleTypes = new [] { typeof(string) })] + string ApiVersionSetId { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of OAuth2 authentication settings included into this API.", + SerializedName = @"oAuth2AuthenticationSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of Open ID Connect authentication settings included into this API.", + SerializedName = @"openidAuthenticationSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The email address of the contact person/organization. MUST be in the format of an email address", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string ContactEmail { get; set; } + /// The identifying name of the contact person/organization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifying name of the contact person/organization", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ContactName { get; set; } + /// The URL pointing to the contact information. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL pointing to the contact information. MUST be in the format of a URL", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string ContactUrl { get; set; } + /// Description of the API. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the API. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// API name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Indicates if API revision is current api revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if API revision is current api revision.", + SerializedName = @"isCurrent", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCurrent { get; set; } + /// Indicates if API revision is accessible via the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if API revision is accessible via the gateway.", + SerializedName = @"isOnline", + PossibleTypes = new [] { typeof(bool) })] + bool? IsOnline { get; } + /// The license name used for the API + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The license name used for the API", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string LicenseName { get; set; } + /// A URL to the license used for the API. MUST be in the format of a URL + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A URL to the license used for the API. MUST be in the format of a URL", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string LicenseUrl { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"authorizationServerId", + PossibleTypes = new [] { typeof(string) })] + string OAuth2AuthorizationServerId { get; set; } + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operations scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string OAuth2Scope { get; set; } + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How to send token to the server.", + SerializedName = @"bearerTokenSendingMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"openidProviderId", + PossibleTypes = new [] { typeof(string) })] + string OpenidProviderId { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Describes on which protocols the operations in this API can be invoked.", + SerializedName = @"protocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// Absolute URL of the backend service implementing this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Absolute URL of the backend service implementing this API.", + SerializedName = @"serviceUrl", + PossibleTypes = new [] { typeof(string) })] + string ServiceUrl { get; set; } + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription key header name.", + SerializedName = @"header", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionKeyParameterNameHeader { get; set; } + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription key query string parameter name.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionKeyParameterNameQuery { get; set; } + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether an API or Product subscription is required for accessing the API.", + SerializedName = @"subscriptionRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionRequired { get; set; } + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @" A URL to the Terms of Service for the API. MUST be in the format of a URL.", + SerializedName = @"termsOfServiceUrl", + PossibleTypes = new [] { typeof(string) })] + string TermsOfServiceUrl { get; set; } + + } + /// API update contract details. + internal partial interface IApiUpdateContractInternal + + { + /// + /// Describes the revision of the API. If no value is provided, default revision 1 is created + /// + string ApiRevision { get; set; } + /// Description of the API Revision. + string ApiRevisionDescription { get; set; } + /// Type of API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType? ApiType { get; set; } + /// Indicates the version identifier of the API if the API is versioned + string ApiVersion { get; set; } + /// Description of the API Version. + string ApiVersionDescription { get; set; } + /// A resource identifier for the related ApiVersionSet. + string ApiVersionSetId { get; set; } + /// Collection of authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract AuthenticationSetting { get; set; } + /// OAuth2 Authentication settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract AuthenticationSettingOAuth2 { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] AuthenticationSettingOAuth2AuthenticationSetting { get; set; } + /// OpenID Connect Authentication Settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract AuthenticationSettingOpenid { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] AuthenticationSettingOpenidAuthenticationSetting { get; set; } + /// Contact information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContactInformation Contact { get; set; } + /// + /// The email address of the contact person/organization. MUST be in the format of an email address + /// + string ContactEmail { get; set; } + /// The identifying name of the contact person/organization + string ContactName { get; set; } + /// The URL pointing to the contact information. MUST be in the format of a URL + string ContactUrl { get; set; } + /// Description of the API. May include HTML formatting tags. + string Description { get; set; } + /// API name. + string DisplayName { get; set; } + /// Indicates if API revision is current api revision. + bool? IsCurrent { get; set; } + /// Indicates if API revision is accessible via the gateway. + bool? IsOnline { get; set; } + /// License information for the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiLicenseInformation License { get; set; } + /// The license name used for the API + string LicenseName { get; set; } + /// A URL to the license used for the API. MUST be in the format of a URL + string LicenseUrl { get; set; } + /// OAuth authorization server identifier. + string OAuth2AuthorizationServerId { get; set; } + /// operations scope. + string OAuth2Scope { get; set; } + /// How to send token to the server. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + string OpenidProviderId { get; set; } + /// + /// Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It + /// is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this + /// API. + /// + string Path { get; set; } + /// Properties of the API entity that can be updated. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiContractUpdateProperties Property { get; set; } + /// Describes on which protocols the operations in this API can be invoked. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol[] Protocol { get; set; } + /// Absolute URL of the backend service implementing this API. + string ServiceUrl { get; set; } + /// Protocols over which API is made available. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract SubscriptionKeyParameterName { get; set; } + /// Subscription key header name. + string SubscriptionKeyParameterNameHeader { get; set; } + /// Subscription key query string parameter name. + string SubscriptionKeyParameterNameQuery { get; set; } + /// + /// Specifies whether an API or Product subscription is required for accessing the API. + /// + bool? SubscriptionRequired { get; set; } + /// A URL to the Terms of Service for the API. MUST be in the format of a URL. + string TermsOfServiceUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiUpdateContract.json.cs new file mode 100644 index 000000000000..8cae9278519b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiUpdateContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API update contract details. + public partial class ApiUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiContractUpdateProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiUpdateContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionConstraint.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionConstraint.cs new file mode 100644 index 000000000000..0f8f73c9e272 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionConstraint.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Control Plane Apis version constraint for the API Management service. + public partial class ApiVersionConstraint : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraintInternal + { + + /// Backing field for property. + private string _minApiVersion; + + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string MinApiVersion { get => this._minApiVersion; set => this._minApiVersion = value; } + + /// Creates an new instance. + public ApiVersionConstraint() + { + + } + } + /// Control Plane Apis version constraint for the API Management service. + public partial interface IApiVersionConstraint : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Limit control plane API calls to API Management service with version equal to or newer than this value.", + SerializedName = @"minApiVersion", + PossibleTypes = new [] { typeof(string) })] + string MinApiVersion { get; set; } + + } + /// Control Plane Apis version constraint for the API Management service. + internal partial interface IApiVersionConstraintInternal + + { + /// + /// Limit control plane API calls to API Management service with version equal to or newer than this value. + /// + string MinApiVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionConstraint.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionConstraint.json.cs new file mode 100644 index 000000000000..afcc3933ce54 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionConstraint.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Control Plane Apis version constraint for the API Management service. + public partial class ApiVersionConstraint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiVersionConstraint(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_minApiVersion = If( json?.PropertyT("minApiVersion"), out var __jsonMinApiVersion) ? (string)__jsonMinApiVersion : (string)MinApiVersion;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionConstraint FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiVersionConstraint(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._minApiVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._minApiVersion.ToString()) : null, "minApiVersion" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetCollection.cs new file mode 100644 index 000000000000..fa059f747ac8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged API Version Set list representation. + public partial class ApiVersionSetCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ApiVersionSetCollection() + { + + } + } + /// Paged API Version Set list representation. + public partial interface IApiVersionSetCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract[] Value { get; set; } + + } + /// Paged API Version Set list representation. + internal partial interface IApiVersionSetCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetCollection.json.cs new file mode 100644 index 000000000000..553babb77e2e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged API Version Set list representation. + public partial class ApiVersionSetCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiVersionSetCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiVersionSetCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContract.cs new file mode 100644 index 000000000000..6e44b6f25c83 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContract.cs @@ -0,0 +1,203 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Version Set Contract details. + public partial class ApiVersionSetContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).Description = value ?? null; } + + /// Name of API Version Set + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractProperties _property; + + /// API VersionSet contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VersionHeaderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).VersionHeaderName = value ?? null; } + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VersionQueryName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).VersionQueryName = value ?? null; } + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractPropertiesInternal)Property).VersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractPropertiesInternal)Property).VersioningScheme = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme)""); } + + /// Creates an new instance. + public ApiVersionSetContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// API Version Set Contract details. + public partial interface IApiVersionSetContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of API Version Set.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Name of API Version Set + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of API Version Set", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.", + SerializedName = @"versionHeaderName", + PossibleTypes = new [] { typeof(string) })] + string VersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of query parameter that indicates the API Version if versioningScheme is set to `query`.", + SerializedName = @"versionQueryName", + PossibleTypes = new [] { typeof(string) })] + string VersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An value that determines where the API Version identifier will be located in a HTTP request.", + SerializedName = @"versioningScheme", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get; set; } + + } + /// API Version Set Contract details. + internal partial interface IApiVersionSetContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Description of API Version Set. + string Description { get; set; } + /// Name of API Version Set + string DisplayName { get; set; } + + string ETag { get; set; } + /// API VersionSet contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractProperties Property { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + string VersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + string VersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContract.json.cs new file mode 100644 index 000000000000..509aaff5b441 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Version Set Contract details. + public partial class ApiVersionSetContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiVersionSetContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiVersionSetContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractDetails.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractDetails.cs new file mode 100644 index 000000000000..88182acb2f70 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractDetails.cs @@ -0,0 +1,162 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// An API Version Set contains the common configuration for a set of API Versions relating + /// + public partial class ApiVersionSetContractDetails : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetailsInternal + { + + /// Backing field for property. + private string _description; + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _id; + + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _name; + + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _versionHeaderName; + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string VersionHeaderName { get => this._versionHeaderName; set => this._versionHeaderName = value; } + + /// Backing field for property. + private string _versionQueryName; + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string VersionQueryName { get => this._versionQueryName; set => this._versionQueryName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? _versioningScheme; + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get => this._versioningScheme; set => this._versioningScheme = value; } + + /// Creates an new instance. + public ApiVersionSetContractDetails() + { + + } + } + /// An API Version Set contains the common configuration for a set of API Versions relating + public partial interface IApiVersionSetContractDetails : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of API Version Set.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier for existing API Version Set. Omit this value to create a new Version Set.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// The display Name of the API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The display Name of the API Version Set.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.", + SerializedName = @"versionHeaderName", + PossibleTypes = new [] { typeof(string) })] + string VersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of query parameter that indicates the API Version if versioningScheme is set to `query`.", + SerializedName = @"versionQueryName", + PossibleTypes = new [] { typeof(string) })] + string VersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An value that determines where the API Version identifier will be located in a HTTP request.", + SerializedName = @"versioningScheme", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get; set; } + + } + /// An API Version Set contains the common configuration for a set of API Versions relating + internal partial interface IApiVersionSetContractDetailsInternal + + { + /// Description of API Version Set. + string Description { get; set; } + /// + /// Identifier for existing API Version Set. Omit this value to create a new Version Set. + /// + string Id { get; set; } + /// The display Name of the API Version Set. + string Name { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + string VersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + string VersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractDetails.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractDetails.json.cs new file mode 100644 index 000000000000..49811774fca6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractDetails.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// An API Version Set contains the common configuration for a set of API Versions relating + /// + public partial class ApiVersionSetContractDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiVersionSetContractDetails(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_versioningScheme = If( json?.PropertyT("versioningScheme"), out var __jsonVersioningScheme) ? (string)__jsonVersioningScheme : (string)VersioningScheme;} + {_versionQueryName = If( json?.PropertyT("versionQueryName"), out var __jsonVersionQueryName) ? (string)__jsonVersionQueryName : (string)VersionQueryName;} + {_versionHeaderName = If( json?.PropertyT("versionHeaderName"), out var __jsonVersionHeaderName) ? (string)__jsonVersionHeaderName : (string)VersionHeaderName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiVersionSetContractDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._versioningScheme)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._versioningScheme.ToString()) : null, "versioningScheme" ,container.Add ); + AddIf( null != (((object)this._versionQueryName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._versionQueryName.ToString()) : null, "versionQueryName" ,container.Add ); + AddIf( null != (((object)this._versionHeaderName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._versionHeaderName.ToString()) : null, "versionHeaderName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractProperties.cs new file mode 100644 index 000000000000..d7deb3d94aee --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractProperties.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of an API Version Set. + public partial class ApiVersionSetContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBase __apiVersionSetEntityBase = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetEntityBase(); + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// Name of API Version Set + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string VersionHeaderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionHeaderName = value ?? null; } + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string VersionQueryName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionQueryName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme _versioningScheme; + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme VersioningScheme { get => this._versioningScheme; set => this._versioningScheme = value; } + + /// Creates an new instance. + public ApiVersionSetContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__apiVersionSetEntityBase), __apiVersionSetEntityBase); + await eventListener.AssertObjectIsValid(nameof(__apiVersionSetEntityBase), __apiVersionSetEntityBase); + } + } + /// Properties of an API Version Set. + public partial interface IApiVersionSetContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBase + { + /// Name of API Version Set + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of API Version Set", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"An value that determines where the API Version identifier will be located in a HTTP request.", + SerializedName = @"versioningScheme", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme VersioningScheme { get; set; } + + } + /// Properties of an API Version Set. + internal partial interface IApiVersionSetContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal + { + /// Name of API Version Set + string DisplayName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme VersioningScheme { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractProperties.json.cs new file mode 100644 index 000000000000..4bb1c6027387 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetContractProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of an API Version Set. + public partial class ApiVersionSetContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiVersionSetContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __apiVersionSetEntityBase = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetEntityBase(json); + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_versioningScheme = If( json?.PropertyT("versioningScheme"), out var __jsonVersioningScheme) ? (string)__jsonVersioningScheme : (string)VersioningScheme;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiVersionSetContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __apiVersionSetEntityBase?.ToJson(container, serializationMode); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._versioningScheme)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._versioningScheme.ToString()) : null, "versioningScheme" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetEntityBase.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetEntityBase.cs new file mode 100644 index 000000000000..2630b4ba828a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetEntityBase.cs @@ -0,0 +1,97 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Version set base parameters + public partial class ApiVersionSetEntityBase : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBase, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal + { + + /// Backing field for property. + private string _description; + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _versionHeaderName; + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string VersionHeaderName { get => this._versionHeaderName; set => this._versionHeaderName = value; } + + /// Backing field for property. + private string _versionQueryName; + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string VersionQueryName { get => this._versionQueryName; set => this._versionQueryName = value; } + + /// Creates an new instance. + public ApiVersionSetEntityBase() + { + + } + } + /// API Version set base parameters + public partial interface IApiVersionSetEntityBase : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of API Version Set.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.", + SerializedName = @"versionHeaderName", + PossibleTypes = new [] { typeof(string) })] + string VersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of query parameter that indicates the API Version if versioningScheme is set to `query`.", + SerializedName = @"versionQueryName", + PossibleTypes = new [] { typeof(string) })] + string VersionQueryName { get; set; } + + } + /// API Version set base parameters + internal partial interface IApiVersionSetEntityBaseInternal + + { + /// Description of API Version Set. + string Description { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + string VersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + string VersionQueryName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetEntityBase.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetEntityBase.json.cs new file mode 100644 index 000000000000..15b2d1fdfe6b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetEntityBase.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Version set base parameters + public partial class ApiVersionSetEntityBase + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiVersionSetEntityBase(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_versionQueryName = If( json?.PropertyT("versionQueryName"), out var __jsonVersionQueryName) ? (string)__jsonVersionQueryName : (string)VersionQueryName;} + {_versionHeaderName = If( json?.PropertyT("versionHeaderName"), out var __jsonVersionHeaderName) ? (string)__jsonVersionHeaderName : (string)VersionHeaderName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBase. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBase. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiVersionSetEntityBase(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._versionQueryName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._versionQueryName.ToString()) : null, "versionQueryName" ,container.Add ); + AddIf( null != (((object)this._versionHeaderName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._versionHeaderName.ToString()) : null, "versionHeaderName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParameters.cs new file mode 100644 index 000000000000..e10cccd5bebf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParameters.cs @@ -0,0 +1,134 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters to update or create an API Version Set Contract. + public partial class ApiVersionSetUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersInternal + { + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).Description = value ?? null; } + + /// Name of API Version Set + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetUpdateParametersProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersProperties _property; + + /// Parameters to update or create an API Version Set Contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetUpdateParametersProperties()); set => this._property = value; } + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VersionHeaderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).VersionHeaderName = value ?? null; } + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string VersionQueryName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)Property).VersionQueryName = value ?? null; } + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersPropertiesInternal)Property).VersioningScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersPropertiesInternal)Property).VersioningScheme = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme)""); } + + /// Creates an new instance. + public ApiVersionSetUpdateParameters() + { + + } + } + /// Parameters to update or create an API Version Set Contract. + public partial interface IApiVersionSetUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of API Version Set.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Name of API Version Set + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of API Version Set", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.", + SerializedName = @"versionHeaderName", + PossibleTypes = new [] { typeof(string) })] + string VersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of query parameter that indicates the API Version if versioningScheme is set to `query`.", + SerializedName = @"versionQueryName", + PossibleTypes = new [] { typeof(string) })] + string VersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An value that determines where the API Version identifier will be located in a HTTP request.", + SerializedName = @"versioningScheme", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get; set; } + + } + /// Parameters to update or create an API Version Set Contract. + internal partial interface IApiVersionSetUpdateParametersInternal + + { + /// Description of API Version Set. + string Description { get; set; } + /// Name of API Version Set + string DisplayName { get; set; } + /// Parameters to update or create an API Version Set Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersProperties Property { get; set; } + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + string VersionHeaderName { get; set; } + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + string VersionQueryName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParameters.json.cs new file mode 100644 index 000000000000..418ceafc3389 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters to update or create an API Version Set Contract. + public partial class ApiVersionSetUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiVersionSetUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetUpdateParametersProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiVersionSetUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParametersProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParametersProperties.cs new file mode 100644 index 000000000000..251582ce42ca --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParametersProperties.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties used to create or update an API Version Set. + public partial class ApiVersionSetUpdateParametersProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBase __apiVersionSetEntityBase = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetEntityBase(); + + /// Description of API Version Set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// Name of API Version Set + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// + /// Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string VersionHeaderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionHeaderName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionHeaderName = value ?? null; } + + /// + /// Name of query parameter that indicates the API Version if versioningScheme is set to `query`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string VersionQueryName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionQueryName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal)__apiVersionSetEntityBase).VersionQueryName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? _versioningScheme; + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get => this._versioningScheme; set => this._versioningScheme = value; } + + /// Creates an new instance. + public ApiVersionSetUpdateParametersProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__apiVersionSetEntityBase), __apiVersionSetEntityBase); + await eventListener.AssertObjectIsValid(nameof(__apiVersionSetEntityBase), __apiVersionSetEntityBase); + } + } + /// Properties used to create or update an API Version Set. + public partial interface IApiVersionSetUpdateParametersProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBase + { + /// Name of API Version Set + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of API Version Set", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An value that determines where the API Version identifier will be located in a HTTP request.", + SerializedName = @"versioningScheme", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get; set; } + + } + /// Properties used to create or update an API Version Set. + internal partial interface IApiVersionSetUpdateParametersPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetEntityBaseInternal + { + /// Name of API Version Set + string DisplayName { get; set; } + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme? VersioningScheme { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParametersProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParametersProperties.json.cs new file mode 100644 index 000000000000..323b612b53e6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApiVersionSetUpdateParametersProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties used to create or update an API Version Set. + public partial class ApiVersionSetUpdateParametersProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiVersionSetUpdateParametersProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __apiVersionSetEntityBase = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiVersionSetEntityBase(json); + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_versioningScheme = If( json?.PropertyT("versioningScheme"), out var __jsonVersioningScheme) ? (string)__jsonVersioningScheme : (string)VersioningScheme;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiVersionSetUpdateParametersProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiVersionSetUpdateParametersProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __apiVersionSetEntityBase?.ToJson(container, serializationMode); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._versioningScheme)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._versioningScheme.ToString()) : null, "versioningScheme" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResource.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResource.cs new file mode 100644 index 000000000000..b07c44fc1d92 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResource.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The Resource definition. + public partial class ApimResource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResource, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal + { + + /// Backing field for property. + private string _id; + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApimResourceTags()); set => this._tag = value; } + + /// Backing field for property. + private string _type; + + /// Resource type for API Management resource is set to Microsoft.ApiManagement. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ApimResource() + { + + } + } + /// The Resource definition. + public partial interface IApimResource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource ID.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags Tag { get; set; } + /// Resource type for API Management resource is set to Microsoft.ApiManagement. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource type for API Management resource is set to Microsoft.ApiManagement.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The Resource definition. + internal partial interface IApimResourceInternal + + { + /// Resource ID. + string Id { get; set; } + /// Resource name. + string Name { get; set; } + /// Resource tags. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags Tag { get; set; } + /// Resource type for API Management resource is set to Microsoft.ApiManagement. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResource.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResource.json.cs new file mode 100644 index 000000000000..f41db6317181 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResource.json.cs @@ -0,0 +1,123 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The Resource definition. + public partial class ApimResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApimResource(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApimResourceTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApimResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResourceTags.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResourceTags.cs new file mode 100644 index 000000000000..f2c26114450b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResourceTags.cs @@ -0,0 +1,35 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resource tags. + public partial class ApimResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTagsInternal + { + + /// Creates an new instance. + public ApimResourceTags() + { + + } + } + /// Resource tags. + public partial interface IApimResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IApimResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResourceTags.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResourceTags.dictionary.cs new file mode 100644 index 000000000000..376605df4c37 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResourceTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApimResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApimResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResourceTags.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResourceTags.json.cs new file mode 100644 index 000000000000..ef2a8a502d66 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ApimResourceTags.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resource tags. + public partial class ApimResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ApimResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApimResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApimResourceTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ArmIdWrapper.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ArmIdWrapper.cs new file mode 100644 index 000000000000..d927b6acc323 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ArmIdWrapper.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A wrapper for an ARM resource id + public partial class ArmIdWrapper : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapper, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapperInternal + { + + /// Backing field for property. + private string _id; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapperInternal.Id { get => this._id; set { {_id = value;} } } + + /// Creates an new instance. + public ArmIdWrapper() + { + + } + } + /// A wrapper for an ARM resource id + public partial interface IArmIdWrapper : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + + } + /// A wrapper for an ARM resource id + internal partial interface IArmIdWrapperInternal + + { + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ArmIdWrapper.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ArmIdWrapper.json.cs new file mode 100644 index 000000000000..fd3709a911ad --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ArmIdWrapper.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A wrapper for an ARM resource id + public partial class ArmIdWrapper + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ArmIdWrapper(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapper. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapper. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapper FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ArmIdWrapper(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContract.cs new file mode 100644 index 000000000000..83bf0b765906 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContract.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Association entity details. + public partial class AssociationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AssociationContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractProperties _property; + + /// Association entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AssociationContractProperties()); set => this._property = value; } + + /// Provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractPropertiesInternal)Property).ProvisioningState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public AssociationContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Association entity details. + public partial interface IAssociationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState? ProvisioningState { get; set; } + + } + /// Association entity details. + internal partial interface IAssociationContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Association entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractProperties Property { get; set; } + /// Provisioning state. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContract.json.cs new file mode 100644 index 000000000000..b1b53d5a7f36 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Association entity details. + public partial class AssociationContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AssociationContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AssociationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AssociationContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContractProperties.cs new file mode 100644 index 000000000000..e8acde96f85e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Association entity contract properties. + public partial class AssociationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState? _provisioningState; + + /// Provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } + + /// Creates an new instance. + public AssociationContractProperties() + { + + } + } + /// Association entity contract properties. + public partial interface IAssociationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState? ProvisioningState { get; set; } + + } + /// Association entity contract properties. + internal partial interface IAssociationContractPropertiesInternal + + { + /// Provisioning state. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContractProperties.json.cs new file mode 100644 index 000000000000..675b49715bea --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AssociationContractProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Association entity contract properties. + public partial class AssociationContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AssociationContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAssociationContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AssociationContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthenticationSettingsContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthenticationSettingsContract.cs new file mode 100644 index 000000000000..27776be64a55 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthenticationSettingsContract.cs @@ -0,0 +1,148 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Authentication Settings. + public partial class AuthenticationSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal + { + + /// Internal Acessors for OAuth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal.OAuth2 { get => (this._oAuth2 = this._oAuth2 ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OAuth2AuthenticationSettingsContract()); set { {_oAuth2 = value;} } } + + /// Internal Acessors for Openid + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContractInternal.Openid { get => (this._openid = this._openid ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenIdAuthenticationSettingsContract()); set { {_openid = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract _oAuth2; + + /// OAuth2 Authentication settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract OAuth2 { get => (this._oAuth2 = this._oAuth2 ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OAuth2AuthenticationSettingsContract()); set => this._oAuth2 = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] _oAuth2AuthenticationSetting; + + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] OAuth2AuthenticationSetting { get => this._oAuth2AuthenticationSetting; set => this._oAuth2AuthenticationSetting = value; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OAuth2AuthorizationServerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContractInternal)OAuth2).AuthorizationServerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContractInternal)OAuth2).AuthorizationServerId = value ?? null; } + + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OAuth2Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContractInternal)OAuth2).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContractInternal)OAuth2).Scope = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract _openid; + + /// OpenID Connect Authentication Settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract Openid { get => (this._openid = this._openid ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenIdAuthenticationSettingsContract()); set => this._openid = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] _openidAuthenticationSetting; + + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] OpenidAuthenticationSetting { get => this._openidAuthenticationSetting; set => this._openidAuthenticationSetting = value; } + + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContractInternal)Openid).BearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContractInternal)Openid).BearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OpenidProviderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContractInternal)Openid).OpenidProviderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContractInternal)Openid).OpenidProviderId = value ?? null; } + + /// Creates an new instance. + public AuthenticationSettingsContract() + { + + } + } + /// API Authentication Settings. + public partial interface IAuthenticationSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Collection of OAuth2 authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of OAuth2 authentication settings included into this API.", + SerializedName = @"oAuth2AuthenticationSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] OAuth2AuthenticationSetting { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"authorizationServerId", + PossibleTypes = new [] { typeof(string) })] + string OAuth2AuthorizationServerId { get; set; } + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operations scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string OAuth2Scope { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of Open ID Connect authentication settings included into this API.", + SerializedName = @"openidAuthenticationSettings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] OpenidAuthenticationSetting { get; set; } + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How to send token to the server.", + SerializedName = @"bearerTokenSendingMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"openidProviderId", + PossibleTypes = new [] { typeof(string) })] + string OpenidProviderId { get; set; } + + } + /// API Authentication Settings. + internal partial interface IAuthenticationSettingsContractInternal + + { + /// OAuth2 Authentication settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract OAuth2 { get; set; } + /// Collection of OAuth2 authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract[] OAuth2AuthenticationSetting { get; set; } + /// OAuth authorization server identifier. + string OAuth2AuthorizationServerId { get; set; } + /// operations scope. + string OAuth2Scope { get; set; } + /// OpenID Connect Authentication Settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract Openid { get; set; } + /// Collection of Open ID Connect authentication settings included into this API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract[] OpenidAuthenticationSetting { get; set; } + /// How to send token to the server. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] OpenidBearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + string OpenidProviderId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthenticationSettingsContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthenticationSettingsContract.json.cs new file mode 100644 index 000000000000..625ac65c4a0a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthenticationSettingsContract.json.cs @@ -0,0 +1,130 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Authentication Settings. + public partial class AuthenticationSettingsContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthenticationSettingsContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_oAuth2 = If( json?.PropertyT("oAuth2"), out var __jsonOAuth2) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OAuth2AuthenticationSettingsContract.FromJson(__jsonOAuth2) : OAuth2;} + {_openid = If( json?.PropertyT("openid"), out var __jsonOpenid) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenIdAuthenticationSettingsContract.FromJson(__jsonOpenid) : Openid;} + {_oAuth2AuthenticationSetting = If( json?.PropertyT("oAuth2AuthenticationSettings"), out var __jsonOAuth2AuthenticationSettings) ? If( __jsonOAuth2AuthenticationSettings as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OAuth2AuthenticationSettingsContract.FromJson(__u) )) ))() : null : OAuth2AuthenticationSetting;} + {_openidAuthenticationSetting = If( json?.PropertyT("openidAuthenticationSettings"), out var __jsonOpenidAuthenticationSettings) ? If( __jsonOpenidAuthenticationSettings as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenIdAuthenticationSettingsContract.FromJson(__p) )) ))() : null : OpenidAuthenticationSetting;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthenticationSettingsContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthenticationSettingsContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._oAuth2 ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._oAuth2.ToJson(null,serializationMode) : null, "oAuth2" ,container.Add ); + AddIf( null != this._openid ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._openid.ToJson(null,serializationMode) : null, "openid" ,container.Add ); + if (null != this._oAuth2AuthenticationSetting) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._oAuth2AuthenticationSetting ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("oAuth2AuthenticationSettings",__w); + } + if (null != this._openidAuthenticationSetting) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._openidAuthenticationSetting ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("openidAuthenticationSettings",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyCollection.cs new file mode 100644 index 000000000000..b1bc61d9ab0e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Authorization Access Policy list representation. + public partial class AuthorizationAccessPolicyCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AuthorizationAccessPolicyCollection() + { + + } + } + /// Paged Authorization Access Policy list representation. + public partial interface IAuthorizationAccessPolicyCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract[] Value { get; set; } + + } + /// Paged Authorization Access Policy list representation. + internal partial interface IAuthorizationAccessPolicyCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyCollection.json.cs new file mode 100644 index 000000000000..d2391f602ae3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyCollection.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Authorization Access Policy list representation. + public partial class AuthorizationAccessPolicyCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationAccessPolicyCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationAccessPolicyContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationAccessPolicyCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContract.cs new file mode 100644 index 000000000000..9e834c0557bb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContract.cs @@ -0,0 +1,157 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization access policy contract. + public partial class AuthorizationAccessPolicyContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// The allowed Azure Active Directory Application IDs + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractPropertiesInternal)Property).AppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractPropertiesInternal)Property).AppId = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationAccessPolicyContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// The Object Id + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractPropertiesInternal)Property).ObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractPropertiesInternal)Property).ObjectId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractProperties _property; + + /// Properties of the Authorization Contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationAccessPolicyContractProperties()); set => this._property = value; } + + /// The Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractPropertiesInternal)Property).TenantId = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public AuthorizationAccessPolicyContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Authorization access policy contract. + public partial interface IAuthorizationAccessPolicyContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// The allowed Azure Active Directory Application IDs + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The allowed Azure Active Directory Application IDs", + SerializedName = @"appIds", + PossibleTypes = new [] { typeof(string) })] + string[] AppId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// The Object Id + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Object Id", + SerializedName = @"objectId", + PossibleTypes = new [] { typeof(string) })] + string ObjectId { get; set; } + /// The Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Tenant Id", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + /// Authorization access policy contract. + internal partial interface IAuthorizationAccessPolicyContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// The allowed Azure Active Directory Application IDs + string[] AppId { get; set; } + + string ETag { get; set; } + /// The Object Id + string ObjectId { get; set; } + /// Properties of the Authorization Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractProperties Property { get; set; } + /// The Tenant Id + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContract.json.cs new file mode 100644 index 000000000000..0bcd27d1e926 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization access policy contract. + public partial class AuthorizationAccessPolicyContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationAccessPolicyContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationAccessPolicyContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationAccessPolicyContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContractProperties.cs new file mode 100644 index 000000000000..5d07619394c4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContractProperties.cs @@ -0,0 +1,87 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Access Policy details. + public partial class AuthorizationAccessPolicyContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractPropertiesInternal + { + + /// Backing field for property. + private string[] _appId; + + /// The allowed Azure Active Directory Application IDs + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] AppId { get => this._appId; set => this._appId = value; } + + /// Backing field for property. + private string _objectId; + + /// The Object Id + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ObjectId { get => this._objectId; set => this._objectId = value; } + + /// Backing field for property. + private string _tenantId; + + /// The Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; set => this._tenantId = value; } + + /// + /// Creates an new instance. + /// + public AuthorizationAccessPolicyContractProperties() + { + + } + } + /// Authorization Access Policy details. + public partial interface IAuthorizationAccessPolicyContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The allowed Azure Active Directory Application IDs + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The allowed Azure Active Directory Application IDs", + SerializedName = @"appIds", + PossibleTypes = new [] { typeof(string) })] + string[] AppId { get; set; } + /// The Object Id + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Object Id", + SerializedName = @"objectId", + PossibleTypes = new [] { typeof(string) })] + string ObjectId { get; set; } + /// The Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Tenant Id", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + /// Authorization Access Policy details. + internal partial interface IAuthorizationAccessPolicyContractPropertiesInternal + + { + /// The allowed Azure Active Directory Application IDs + string[] AppId { get; set; } + /// The Object Id + string ObjectId { get; set; } + /// The Tenant Id + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContractProperties.json.cs new file mode 100644 index 000000000000..96ecd9ac3fe0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationAccessPolicyContractProperties.json.cs @@ -0,0 +1,122 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Access Policy details. + public partial class AuthorizationAccessPolicyContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationAccessPolicyContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_appId = If( json?.PropertyT("appIds"), out var __jsonAppIds) ? If( __jsonAppIds as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AppId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_objectId = If( json?.PropertyT("objectId"), out var __jsonObjectId) ? (string)__jsonObjectId : (string)ObjectId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationAccessPolicyContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationAccessPolicyContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._appId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._appId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("appIds",__w); + } + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + AddIf( null != (((object)this._objectId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._objectId.ToString()) : null, "objectId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationCollection.cs new file mode 100644 index 000000000000..dc0a22ffcb43 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Authorization list representation. + public partial class AuthorizationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AuthorizationCollection() + { + + } + } + /// Paged Authorization list representation. + public partial interface IAuthorizationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract[] Value { get; set; } + + } + /// Paged Authorization list representation. + internal partial interface IAuthorizationCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationCollection.json.cs new file mode 100644 index 000000000000..98ad2cae656a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Authorization list representation. + public partial class AuthorizationCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationConfirmConsentCodeRequestContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationConfirmConsentCodeRequestContract.cs new file mode 100644 index 000000000000..1600c7dee555 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationConfirmConsentCodeRequestContract.cs @@ -0,0 +1,59 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization confirm consent code request contract. + public partial class AuthorizationConfirmConsentCodeRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationConfirmConsentCodeRequestContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationConfirmConsentCodeRequestContractInternal + { + + /// Backing field for property. + private string _consentCode; + + /// + /// The consent code from the authorization server after authorizing and consenting. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ConsentCode { get => this._consentCode; set => this._consentCode = value; } + + /// + /// Creates an new instance. + /// + public AuthorizationConfirmConsentCodeRequestContract() + { + + } + } + /// Authorization confirm consent code request contract. + public partial interface IAuthorizationConfirmConsentCodeRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The consent code from the authorization server after authorizing and consenting. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The consent code from the authorization server after authorizing and consenting.", + SerializedName = @"consentCode", + PossibleTypes = new [] { typeof(string) })] + string ConsentCode { get; set; } + + } + /// Authorization confirm consent code request contract. + internal partial interface IAuthorizationConfirmConsentCodeRequestContractInternal + + { + /// + /// The consent code from the authorization server after authorizing and consenting. + /// + string ConsentCode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationConfirmConsentCodeRequestContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationConfirmConsentCodeRequestContract.json.cs new file mode 100644 index 000000000000..792dd67b7fe2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationConfirmConsentCodeRequestContract.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization confirm consent code request contract. + public partial class AuthorizationConfirmConsentCodeRequestContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationConfirmConsentCodeRequestContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_consentCode = If( json?.PropertyT("consentCode"), out var __jsonConsentCode) ? (string)__jsonConsentCode : (string)ConsentCode;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationConfirmConsentCodeRequestContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationConfirmConsentCodeRequestContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationConfirmConsentCodeRequestContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationConfirmConsentCodeRequestContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._consentCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._consentCode.ToString()) : null, "consentCode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContract.cs new file mode 100644 index 000000000000..40091ed6bcaa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContract.cs @@ -0,0 +1,204 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization contract. + public partial class AuthorizationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Authorization type options + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType? AuthorizationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).AuthorizationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).AuthorizationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType)""); } + + /// Error code + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).Code = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).Message = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationError Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).Error = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// OAuth2 grant type options + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType? OAuth2GrantType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).OAuth2GrantType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).OAuth2GrantType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType)""); } + + /// Authorization parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).Parameter = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractProperties _property; + + /// Properties of the Authorization Contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationContractProperties()); set => this._property = value; } + + /// Status of the Authorization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal)Property).Status = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public AuthorizationContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Authorization contract. + public partial interface IAuthorizationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Authorization type options + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization type options", + SerializedName = @"authorizationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType? AuthorizationType { get; set; } + /// Error code + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// OAuth2 grant type options + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth2 grant type options", + SerializedName = @"oauth2grantType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType? OAuth2GrantType { get; set; } + /// Authorization parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization parameters", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters Parameter { get; set; } + /// Status of the Authorization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the Authorization", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + + } + /// Authorization contract. + internal partial interface IAuthorizationContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Authorization type options + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType? AuthorizationType { get; set; } + /// Error code + string Code { get; set; } + + string ETag { get; set; } + /// Authorization error details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationError Error { get; set; } + /// Error message + string Message { get; set; } + /// OAuth2 grant type options + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType? OAuth2GrantType { get; set; } + /// Authorization parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters Parameter { get; set; } + /// Properties of the Authorization Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractProperties Property { get; set; } + /// Status of the Authorization + string Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContract.json.cs new file mode 100644 index 000000000000..cefeacb669dc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization contract. + public partial class AuthorizationContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractProperties.cs new file mode 100644 index 000000000000..63edbea3e670 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractProperties.cs @@ -0,0 +1,142 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization details. + public partial class AuthorizationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType? _authorizationType; + + /// Authorization type options + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType? AuthorizationType { get => this._authorizationType; set => this._authorizationType = value; } + + /// Error code + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationErrorInternal)Error).Code = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationError _error; + + /// Authorization error details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationError()); set => this._error = value; } + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationErrorInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationError Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationError()); set { {_error = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType? _oAuth2GrantType; + + /// OAuth2 grant type options + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType? OAuth2GrantType { get => this._oAuth2GrantType; set => this._oAuth2GrantType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters _parameter; + + /// Authorization parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationContractPropertiesParameters()); set => this._parameter = value; } + + /// Backing field for property. + private string _status; + + /// Status of the Authorization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public AuthorizationContractProperties() + { + + } + } + /// Authorization details. + public partial interface IAuthorizationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Authorization type options + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization type options", + SerializedName = @"authorizationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType? AuthorizationType { get; set; } + /// Error code + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// OAuth2 grant type options + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth2 grant type options", + SerializedName = @"oauth2grantType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType? OAuth2GrantType { get; set; } + /// Authorization parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization parameters", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters Parameter { get; set; } + /// Status of the Authorization + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the Authorization", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + + } + /// Authorization details. + internal partial interface IAuthorizationContractPropertiesInternal + + { + /// Authorization type options + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType? AuthorizationType { get; set; } + /// Error code + string Code { get; set; } + /// Authorization error details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationError Error { get; set; } + /// Error message + string Message { get; set; } + /// OAuth2 grant type options + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType? OAuth2GrantType { get; set; } + /// Authorization parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters Parameter { get; set; } + /// Status of the Authorization + string Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractProperties.json.cs new file mode 100644 index 000000000000..3e7fffec82e6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractProperties.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization details. + public partial class AuthorizationContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationError.FromJson(__jsonError) : Error;} + {_authorizationType = If( json?.PropertyT("authorizationType"), out var __jsonAuthorizationType) ? (string)__jsonAuthorizationType : (string)AuthorizationType;} + {_oAuth2GrantType = If( json?.PropertyT("oauth2grantType"), out var __jsonOauth2GrantType) ? (string)__jsonOauth2GrantType : (string)OAuth2GrantType;} + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationContractPropertiesParameters.FromJson(__jsonParameters) : Parameter;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AddIf( null != (((object)this._authorizationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._authorizationType.ToString()) : null, "authorizationType" ,container.Add ); + AddIf( null != (((object)this._oAuth2GrantType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._oAuth2GrantType.ToString()) : null, "oauth2grantType" ,container.Add ); + AddIf( null != this._parameter ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._parameter.ToJson(null,serializationMode) : null, "parameters" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractPropertiesParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractPropertiesParameters.cs new file mode 100644 index 000000000000..cbc1beda63c7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractPropertiesParameters.cs @@ -0,0 +1,37 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization parameters + public partial class AuthorizationContractPropertiesParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParametersInternal + { + + /// + /// Creates an new instance. + /// + public AuthorizationContractPropertiesParameters() + { + + } + } + /// Authorization parameters + public partial interface IAuthorizationContractPropertiesParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// Authorization parameters + internal partial interface IAuthorizationContractPropertiesParametersInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractPropertiesParameters.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractPropertiesParameters.dictionary.cs new file mode 100644 index 000000000000..5a74a48f65ee --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractPropertiesParameters.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class AuthorizationContractPropertiesParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationContractPropertiesParameters source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractPropertiesParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractPropertiesParameters.json.cs new file mode 100644 index 000000000000..f5e7c2f55831 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationContractPropertiesParameters.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization parameters + public partial class AuthorizationContractPropertiesParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AuthorizationContractPropertiesParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationContractPropertiesParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationContractPropertiesParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationError.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationError.cs new file mode 100644 index 000000000000..f0a5aa51fdb6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationError.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization error details. + public partial class AuthorizationError : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationError, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationErrorInternal + { + + /// Backing field for property. + private string _code; + + /// Error code + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public AuthorizationError() + { + + } + } + /// Authorization error details. + public partial interface IAuthorizationError : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Error code + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Error message + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// Authorization error details. + internal partial interface IAuthorizationErrorInternal + + { + /// Error code + string Code { get; set; } + /// Error message + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationError.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationError.json.cs new file mode 100644 index 000000000000..9d723aa450fd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationError.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization error details. + public partial class AuthorizationError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationError(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationError(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginRequestContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginRequestContract.cs new file mode 100644 index 000000000000..1321785854b7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginRequestContract.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization login request contract. + public partial class AuthorizationLoginRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginRequestContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginRequestContractInternal + { + + /// Backing field for property. + private string _postLoginRedirectUrl; + + /// The redirect URL after login has completed. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PostLoginRedirectUrl { get => this._postLoginRedirectUrl; set => this._postLoginRedirectUrl = value; } + + /// Creates an new instance. + public AuthorizationLoginRequestContract() + { + + } + } + /// Authorization login request contract. + public partial interface IAuthorizationLoginRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The redirect URL after login has completed. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The redirect URL after login has completed.", + SerializedName = @"postLoginRedirectUrl", + PossibleTypes = new [] { typeof(string) })] + string PostLoginRedirectUrl { get; set; } + + } + /// Authorization login request contract. + internal partial interface IAuthorizationLoginRequestContractInternal + + { + /// The redirect URL after login has completed. + string PostLoginRedirectUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginRequestContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginRequestContract.json.cs new file mode 100644 index 000000000000..2d1408376ae1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginRequestContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization login request contract. + public partial class AuthorizationLoginRequestContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationLoginRequestContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_postLoginRedirectUrl = If( json?.PropertyT("postLoginRedirectUrl"), out var __jsonPostLoginRedirectUrl) ? (string)__jsonPostLoginRedirectUrl : (string)PostLoginRedirectUrl;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginRequestContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginRequestContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginRequestContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationLoginRequestContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._postLoginRedirectUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._postLoginRedirectUrl.ToString()) : null, "postLoginRedirectUrl" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginResponseContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginResponseContract.cs new file mode 100644 index 000000000000..dc4495c977af --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginResponseContract.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization login response contract. + public partial class AuthorizationLoginResponseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginResponseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginResponseContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Backing field for property. + private string _loginLink; + + /// The login link + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string LoginLink { get => this._loginLink; set => this._loginLink = value; } + + /// Creates an new instance. + public AuthorizationLoginResponseContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginResponseContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + /// Authorization login response contract. + public partial interface IAuthorizationLoginResponseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// The login link + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The login link", + SerializedName = @"loginLink", + PossibleTypes = new [] { typeof(string) })] + string LoginLink { get; set; } + + } + /// Authorization login response contract. + internal partial interface IAuthorizationLoginResponseContractInternal + + { + string ETag { get; set; } + /// The login link + string LoginLink { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginResponseContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginResponseContract.json.cs new file mode 100644 index 000000000000..3d0d3ab8d0fa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationLoginResponseContract.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization login response contract. + public partial class AuthorizationLoginResponseContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationLoginResponseContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_loginLink = If( json?.PropertyT("loginLink"), out var __jsonLoginLink) ? (string)__jsonLoginLink : (string)LoginLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginResponseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginResponseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationLoginResponseContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationLoginResponseContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._loginLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._loginLink.ToString()) : null, "loginLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderCollection.cs new file mode 100644 index 000000000000..a115603ff9f6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderCollection.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Authorization Provider list representation. + public partial class AuthorizationProviderCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderCollectionInternal + { + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AuthorizationProviderCollection() + { + + } + } + /// Paged Authorization Provider list representation. + public partial interface IAuthorizationProviderCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract[] Value { get; set; } + + } + /// Paged Authorization Provider list representation. + internal partial interface IAuthorizationProviderCollectionInternal + + { + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderCollection.json.cs new file mode 100644 index 000000000000..864cb4852289 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderCollection.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Authorization Provider list representation. + public partial class AuthorizationProviderCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationProviderCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationProviderCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContract.cs new file mode 100644 index 000000000000..649a2ac78be7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContract.cs @@ -0,0 +1,195 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Provider contract. + public partial class AuthorizationProviderContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Authorization Provider name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// OAuth2 authorization code grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).GrantTypeAuthorizationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).GrantTypeAuthorizationCode = value ?? null /* model class */; } + + /// OAuth2 client credential grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).GrantTypeClientCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).GrantTypeClientCredentials = value ?? null /* model class */; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Identity provider name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string IdentityProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).IdentityProvider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).IdentityProvider = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Oauth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2Settings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractInternal.Oauth2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2 = value; } + + /// Internal Acessors for Oauth2GrantType + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractInternal.Oauth2GrantType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2GrantType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2GrantType = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Redirect URL to be set in the OAuth application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Oauth2RedirectUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2RedirectUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal)Property).Oauth2RedirectUrl = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractProperties _property; + + /// Properties of the Authorization Provider Contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public AuthorizationProviderContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Authorization Provider contract. + public partial interface IAuthorizationProviderContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Authorization Provider name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization Provider name. Must be 1 to 300 characters long.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// OAuth2 authorization code grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth2 authorization code grant parameters", + SerializedName = @"authorizationCode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth2 client credential grant parameters", + SerializedName = @"clientCredentials", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get; set; } + /// Identity provider name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity provider name. Must be 1 to 300 characters long.", + SerializedName = @"identityProvider", + PossibleTypes = new [] { typeof(string) })] + string IdentityProvider { get; set; } + /// Redirect URL to be set in the OAuth application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect URL to be set in the OAuth application.", + SerializedName = @"redirectUrl", + PossibleTypes = new [] { typeof(string) })] + string Oauth2RedirectUrl { get; set; } + + } + /// Authorization Provider contract. + internal partial interface IAuthorizationProviderContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Authorization Provider name. Must be 1 to 300 characters long. + string DisplayName { get; set; } + + string ETag { get; set; } + /// OAuth2 authorization code grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get; set; } + /// Identity provider name. Must be 1 to 300 characters long. + string IdentityProvider { get; set; } + /// OAuth2 settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2Settings Oauth2 { get; set; } + /// OAuth2 settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes Oauth2GrantType { get; set; } + /// Redirect URL to be set in the OAuth application. + string Oauth2RedirectUrl { get; set; } + /// Properties of the Authorization Provider Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContract.json.cs new file mode 100644 index 000000000000..f8c58dbe3c87 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Provider contract. + public partial class AuthorizationProviderContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationProviderContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationProviderContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContractProperties.cs new file mode 100644 index 000000000000..d5acc91177e7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContractProperties.cs @@ -0,0 +1,127 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Provider details. + public partial class AuthorizationProviderContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal + { + + /// Backing field for property. + private string _displayName; + + /// Authorization Provider name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// OAuth2 authorization code grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).GrantTypeAuthorizationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).GrantTypeAuthorizationCode = value ?? null /* model class */; } + + /// OAuth2 client credential grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).GrantTypeClientCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).GrantTypeClientCredentials = value ?? null /* model class */; } + + /// Backing field for property. + private string _identityProvider; + + /// Identity provider name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string IdentityProvider { get => this._identityProvider; set => this._identityProvider = value; } + + /// Internal Acessors for Oauth2 + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2Settings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal.Oauth2 { get => (this._oauth2 = this._oauth2 ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2Settings()); set { {_oauth2 = value;} } } + + /// Internal Acessors for Oauth2GrantType + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractPropertiesInternal.Oauth2GrantType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).GrantType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).GrantType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2Settings _oauth2; + + /// OAuth2 settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2Settings Oauth2 { get => (this._oauth2 = this._oauth2 ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2Settings()); set => this._oauth2 = value; } + + /// Redirect URL to be set in the OAuth application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Oauth2RedirectUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).RedirectUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2SettingsInternal)Oauth2).RedirectUrl = value ?? null; } + + /// Creates an new instance. + public AuthorizationProviderContractProperties() + { + + } + } + /// Authorization Provider details. + public partial interface IAuthorizationProviderContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Authorization Provider name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization Provider name. Must be 1 to 300 characters long.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// OAuth2 authorization code grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth2 authorization code grant parameters", + SerializedName = @"authorizationCode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth2 client credential grant parameters", + SerializedName = @"clientCredentials", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get; set; } + /// Identity provider name. Must be 1 to 300 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity provider name. Must be 1 to 300 characters long.", + SerializedName = @"identityProvider", + PossibleTypes = new [] { typeof(string) })] + string IdentityProvider { get; set; } + /// Redirect URL to be set in the OAuth application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect URL to be set in the OAuth application.", + SerializedName = @"redirectUrl", + PossibleTypes = new [] { typeof(string) })] + string Oauth2RedirectUrl { get; set; } + + } + /// Authorization Provider details. + internal partial interface IAuthorizationProviderContractPropertiesInternal + + { + /// Authorization Provider name. Must be 1 to 300 characters long. + string DisplayName { get; set; } + /// OAuth2 authorization code grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get; set; } + /// Identity provider name. Must be 1 to 300 characters long. + string IdentityProvider { get; set; } + /// OAuth2 settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2Settings Oauth2 { get; set; } + /// OAuth2 settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes Oauth2GrantType { get; set; } + /// Redirect URL to be set in the OAuth application. + string Oauth2RedirectUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContractProperties.json.cs new file mode 100644 index 000000000000..99b017e92437 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderContractProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Provider details. + public partial class AuthorizationProviderContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationProviderContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_oauth2 = If( json?.PropertyT("oauth2"), out var __jsonOauth2) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2Settings.FromJson(__jsonOauth2) : Oauth2;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_identityProvider = If( json?.PropertyT("identityProvider"), out var __jsonIdentityProvider) ? (string)__jsonIdentityProvider : (string)IdentityProvider;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationProviderContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._oauth2 ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._oauth2.ToJson(null,serializationMode) : null, "oauth2" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._identityProvider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._identityProvider.ToString()) : null, "identityProvider" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypes.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypes.cs new file mode 100644 index 000000000000..498470a546df --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypes.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Provider oauth2 grant types settings + public partial class AuthorizationProviderOAuth2GrantTypes : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode _authorizationCode; + + /// OAuth2 authorization code grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode AuthorizationCode { get => (this._authorizationCode = this._authorizationCode ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2GrantTypesAuthorizationCode()); set => this._authorizationCode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials _clientCredentials; + + /// OAuth2 client credential grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials ClientCredentials { get => (this._clientCredentials = this._clientCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2GrantTypesClientCredentials()); set => this._clientCredentials = value; } + + /// Creates an new instance. + public AuthorizationProviderOAuth2GrantTypes() + { + + } + } + /// Authorization Provider oauth2 grant types settings + public partial interface IAuthorizationProviderOAuth2GrantTypes : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// OAuth2 authorization code grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth2 authorization code grant parameters", + SerializedName = @"authorizationCode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode AuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth2 client credential grant parameters", + SerializedName = @"clientCredentials", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials ClientCredentials { get; set; } + + } + /// Authorization Provider oauth2 grant types settings + internal partial interface IAuthorizationProviderOAuth2GrantTypesInternal + + { + /// OAuth2 authorization code grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode AuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials ClientCredentials { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypes.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypes.json.cs new file mode 100644 index 000000000000..f597cb07052e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypes.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization Provider oauth2 grant types settings + public partial class AuthorizationProviderOAuth2GrantTypes + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationProviderOAuth2GrantTypes(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authorizationCode = If( json?.PropertyT("authorizationCode"), out var __jsonAuthorizationCode) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2GrantTypesAuthorizationCode.FromJson(__jsonAuthorizationCode) : AuthorizationCode;} + {_clientCredentials = If( json?.PropertyT("clientCredentials"), out var __jsonClientCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2GrantTypesClientCredentials.FromJson(__jsonClientCredentials) : ClientCredentials;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationProviderOAuth2GrantTypes(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._authorizationCode ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._authorizationCode.ToJson(null,serializationMode) : null, "authorizationCode" ,container.Add ); + AddIf( null != this._clientCredentials ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._clientCredentials.ToJson(null,serializationMode) : null, "clientCredentials" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.cs new file mode 100644 index 000000000000..bcf9570d819d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.cs @@ -0,0 +1,37 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth2 authorization code grant parameters + public partial class AuthorizationProviderOAuth2GrantTypesAuthorizationCode : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCodeInternal + { + + /// + /// Creates an new instance. + /// + public AuthorizationProviderOAuth2GrantTypesAuthorizationCode() + { + + } + } + /// OAuth2 authorization code grant parameters + public partial interface IAuthorizationProviderOAuth2GrantTypesAuthorizationCode : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// OAuth2 authorization code grant parameters + internal partial interface IAuthorizationProviderOAuth2GrantTypesAuthorizationCodeInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.dictionary.cs new file mode 100644 index 000000000000..7ed3eb131c2e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class AuthorizationProviderOAuth2GrantTypesAuthorizationCode : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2GrantTypesAuthorizationCode source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.json.cs new file mode 100644 index 000000000000..dc859f2ab17f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesAuthorizationCode.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth2 authorization code grant parameters + public partial class AuthorizationProviderOAuth2GrantTypesAuthorizationCode + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AuthorizationProviderOAuth2GrantTypesAuthorizationCode(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationProviderOAuth2GrantTypesAuthorizationCode(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesClientCredentials.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesClientCredentials.cs new file mode 100644 index 000000000000..f0330955c465 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesClientCredentials.cs @@ -0,0 +1,37 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth2 client credential grant parameters + public partial class AuthorizationProviderOAuth2GrantTypesClientCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentialsInternal + { + + /// + /// Creates an new instance. + /// + public AuthorizationProviderOAuth2GrantTypesClientCredentials() + { + + } + } + /// OAuth2 client credential grant parameters + public partial interface IAuthorizationProviderOAuth2GrantTypesClientCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// OAuth2 client credential grant parameters + internal partial interface IAuthorizationProviderOAuth2GrantTypesClientCredentialsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesClientCredentials.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesClientCredentials.dictionary.cs new file mode 100644 index 000000000000..f5ab0ecef269 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesClientCredentials.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class AuthorizationProviderOAuth2GrantTypesClientCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2GrantTypesClientCredentials source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesClientCredentials.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesClientCredentials.json.cs new file mode 100644 index 000000000000..f5a7eb08a449 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2GrantTypesClientCredentials.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth2 client credential grant parameters + public partial class AuthorizationProviderOAuth2GrantTypesClientCredentials + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AuthorizationProviderOAuth2GrantTypesClientCredentials(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationProviderOAuth2GrantTypesClientCredentials(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2Settings.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2Settings.cs new file mode 100644 index 000000000000..d9a347beab13 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2Settings.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth2 settings details + public partial class AuthorizationProviderOAuth2Settings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2Settings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2SettingsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes _grantType; + + /// OAuth2 settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes GrantType { get => (this._grantType = this._grantType ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2GrantTypes()); set => this._grantType = value; } + + /// OAuth2 authorization code grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesInternal)GrantType).AuthorizationCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesInternal)GrantType).AuthorizationCode = value ?? null /* model class */; } + + /// OAuth2 client credential grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesInternal)GrantType).ClientCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesInternal)GrantType).ClientCredentials = value ?? null /* model class */; } + + /// Internal Acessors for GrantType + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2SettingsInternal.GrantType { get => (this._grantType = this._grantType ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2GrantTypes()); set { {_grantType = value;} } } + + /// Backing field for property. + private string _redirectUrl; + + /// Redirect URL to be set in the OAuth application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string RedirectUrl { get => this._redirectUrl; set => this._redirectUrl = value; } + + /// Creates an new instance. + public AuthorizationProviderOAuth2Settings() + { + + } + } + /// OAuth2 settings details + public partial interface IAuthorizationProviderOAuth2Settings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// OAuth2 authorization code grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth2 authorization code grant parameters", + SerializedName = @"authorizationCode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth2 client credential grant parameters", + SerializedName = @"clientCredentials", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get; set; } + /// Redirect URL to be set in the OAuth application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect URL to be set in the OAuth application.", + SerializedName = @"redirectUrl", + PossibleTypes = new [] { typeof(string) })] + string RedirectUrl { get; set; } + + } + /// OAuth2 settings details + internal partial interface IAuthorizationProviderOAuth2SettingsInternal + + { + /// OAuth2 settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypes GrantType { get; set; } + /// OAuth2 authorization code grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesAuthorizationCode GrantTypeAuthorizationCode { get; set; } + /// OAuth2 client credential grant parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2GrantTypesClientCredentials GrantTypeClientCredentials { get; set; } + /// Redirect URL to be set in the OAuth application. + string RedirectUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2Settings.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2Settings.json.cs new file mode 100644 index 000000000000..dcfa778a93ea --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationProviderOAuth2Settings.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth2 settings details + public partial class AuthorizationProviderOAuth2Settings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationProviderOAuth2Settings(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_grantType = If( json?.PropertyT("grantTypes"), out var __jsonGrantTypes) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationProviderOAuth2GrantTypes.FromJson(__jsonGrantTypes) : GrantType;} + {_redirectUrl = If( json?.PropertyT("redirectUrl"), out var __jsonRedirectUrl) ? (string)__jsonRedirectUrl : (string)RedirectUrl;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2Settings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2Settings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationProviderOAuth2Settings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationProviderOAuth2Settings(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._grantType ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._grantType.ToJson(null,serializationMode) : null, "grantTypes" ,container.Add ); + AddIf( null != (((object)this._redirectUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._redirectUrl.ToString()) : null, "redirectUrl" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerCollection.cs new file mode 100644 index 000000000000..d6554cbbf32e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged OAuth2 Authorization Servers list representation. + public partial class AuthorizationServerCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AuthorizationServerCollection() + { + + } + } + /// Paged OAuth2 Authorization Servers list representation. + public partial interface IAuthorizationServerCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract[] Value { get; set; } + + } + /// Paged OAuth2 Authorization Servers list representation. + internal partial interface IAuthorizationServerCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerCollection.json.cs new file mode 100644 index 000000000000..985e5e96ca5d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged OAuth2 Authorization Servers list representation. + public partial class AuthorizationServerCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationServerCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationServerCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContract.cs new file mode 100644 index 000000000000..a0732c90e4e6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContract.cs @@ -0,0 +1,475 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server settings. + public partial class AuthorizationServerContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string AuthorizationEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).AuthorizationEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).AuthorizationEndpoint = value ?? null; } + + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).AuthorizationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).AuthorizationMethod = value ?? null /* arrayOf */; } + + /// Specifies the mechanism by which access token is passed to the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).BearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).BearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ClientAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ClientAuthenticationMethod = value ?? null /* arrayOf */; } + + /// Client or app id registered with this authorization server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).ClientId = value ?? null; } + + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientRegistrationEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).ClientRegistrationEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).ClientRegistrationEndpoint = value ?? null; } + + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).ClientSecret = value ?? null; } + + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DefaultScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).DefaultScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).DefaultScope = value ?? null; } + + /// Description of the authorization server. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).Description = value ?? null; } + + /// User-friendly authorization server name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).GrantType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).GrantType = value ?? null /* arrayOf */; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractProperties _property; + + /// Properties of the External OAuth authorization server Contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContractProperties()); set => this._property = value; } + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResourceOwnerPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerPassword = value ?? null; } + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResourceOwnerUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerUsername = value ?? null; } + + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SupportState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).SupportState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).SupportState = value ?? default(bool); } + + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).TokenBodyParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).TokenBodyParameter = value ?? null /* arrayOf */; } + + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TokenEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).TokenEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).TokenEndpoint = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UseInApiDocumentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).UseInApiDocumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).UseInApiDocumentation = value ?? default(bool); } + + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UseInTestConsole { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).UseInTestConsole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal)Property).UseInTestConsole = value ?? default(bool); } + + /// Creates an new instance. + public AuthorizationServerContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// External OAuth authorization server settings. + public partial interface IAuthorizationServerContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.", + SerializedName = @"authorizationEndpoint", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationEndpoint { get; set; } + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.", + SerializedName = @"authorizationMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get; set; } + /// Specifies the mechanism by which access token is passed to the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the mechanism by which access token is passed to the API. ", + SerializedName = @"bearerTokenSendingMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get; set; } + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format.", + SerializedName = @"clientAuthenticationMethod", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get; set; } + /// Client or app id registered with this authorization server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client or app id registered with this authorization server.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.", + SerializedName = @"clientRegistrationEndpoint", + PossibleTypes = new [] { typeof(string) })] + string ClientRegistrationEndpoint { get; set; } + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values.", + SerializedName = @"defaultScope", + PossibleTypes = new [] { typeof(string) })] + string DefaultScope { get; set; } + /// Description of the authorization server. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the authorization server. Can contain HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// User-friendly authorization server name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-friendly authorization server name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Form of an authorization grant, which the client uses to request the access token.", + SerializedName = @"grantTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.", + SerializedName = @"resourceOwnerPassword", + PossibleTypes = new [] { typeof(string) })] + string ResourceOwnerPassword { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.", + SerializedName = @"resourceOwnerUsername", + PossibleTypes = new [] { typeof(string) })] + string ResourceOwnerUsername { get; set; } + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security.", + SerializedName = @"supportState", + PossibleTypes = new [] { typeof(bool) })] + bool? SupportState { get; set; } + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {""name"" : ""name value"", ""value"": ""a value""}.", + SerializedName = @"tokenBodyParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get; set; } + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth token endpoint. Contains absolute URI to entity being referenced.", + SerializedName = @"tokenEndpoint", + PossibleTypes = new [] { typeof(string) })] + string TokenEndpoint { get; set; } + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the authorization server will be used in the API documentation in the developer portal. False by default if no value is provided.", + SerializedName = @"useInApiDocumentation", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the authorization server may be used in the developer portal test console. True by default if no value is provided.", + SerializedName = @"useInTestConsole", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInTestConsole { get; set; } + + } + /// External OAuth authorization server settings. + internal partial interface IAuthorizationServerContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + string AuthorizationEndpoint { get; set; } + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get; set; } + /// Specifies the mechanism by which access token is passed to the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get; set; } + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get; set; } + /// Client or app id registered with this authorization server. + string ClientId { get; set; } + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + string ClientRegistrationEndpoint { get; set; } + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + string ClientSecret { get; set; } + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + string DefaultScope { get; set; } + /// Description of the authorization server. Can contain HTML formatting tags. + string Description { get; set; } + /// User-friendly authorization server name. + string DisplayName { get; set; } + + string ETag { get; set; } + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get; set; } + /// Properties of the External OAuth authorization server Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractProperties Property { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + string ResourceOwnerPassword { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + string ResourceOwnerUsername { get; set; } + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + bool? SupportState { get; set; } + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get; set; } + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + string TokenEndpoint { get; set; } + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + bool? UseInTestConsole { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContract.json.cs new file mode 100644 index 000000000000..9494b6b5bb09 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server settings. + public partial class AuthorizationServerContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationServerContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationServerContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractBaseProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractBaseProperties.cs new file mode 100644 index 000000000000..2190dce86471 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractBaseProperties.cs @@ -0,0 +1,269 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server Update settings contract. + public partial class AuthorizationServerContractBaseProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBaseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] _authorizationMethod; + + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get => this._authorizationMethod; set => this._authorizationMethod = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] _bearerTokenSendingMethod; + + /// Specifies the mechanism by which access token is passed to the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get => this._bearerTokenSendingMethod; set => this._bearerTokenSendingMethod = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] _clientAuthenticationMethod; + + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get => this._clientAuthenticationMethod; set => this._clientAuthenticationMethod = value; } + + /// Backing field for property. + private string _defaultScope; + + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DefaultScope { get => this._defaultScope; set => this._defaultScope = value; } + + /// Backing field for property. + private string _description; + + /// Description of the authorization server. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _resourceOwnerPassword; + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceOwnerPassword { get => this._resourceOwnerPassword; set => this._resourceOwnerPassword = value; } + + /// Backing field for property. + private string _resourceOwnerUsername; + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceOwnerUsername { get => this._resourceOwnerUsername; set => this._resourceOwnerUsername = value; } + + /// Backing field for property. + private bool? _supportState; + + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? SupportState { get => this._supportState; set => this._supportState = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] _tokenBodyParameter; + + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get => this._tokenBodyParameter; set => this._tokenBodyParameter = value; } + + /// Backing field for property. + private string _tokenEndpoint; + + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TokenEndpoint { get => this._tokenEndpoint; set => this._tokenEndpoint = value; } + + /// + /// Creates an new instance. + /// + public AuthorizationServerContractBaseProperties() + { + + } + } + /// External OAuth authorization server Update settings contract. + public partial interface IAuthorizationServerContractBaseProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.", + SerializedName = @"authorizationMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get; set; } + /// Specifies the mechanism by which access token is passed to the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the mechanism by which access token is passed to the API. ", + SerializedName = @"bearerTokenSendingMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get; set; } + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format.", + SerializedName = @"clientAuthenticationMethod", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get; set; } + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values.", + SerializedName = @"defaultScope", + PossibleTypes = new [] { typeof(string) })] + string DefaultScope { get; set; } + /// Description of the authorization server. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the authorization server. Can contain HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.", + SerializedName = @"resourceOwnerPassword", + PossibleTypes = new [] { typeof(string) })] + string ResourceOwnerPassword { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.", + SerializedName = @"resourceOwnerUsername", + PossibleTypes = new [] { typeof(string) })] + string ResourceOwnerUsername { get; set; } + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security.", + SerializedName = @"supportState", + PossibleTypes = new [] { typeof(bool) })] + bool? SupportState { get; set; } + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {""name"" : ""name value"", ""value"": ""a value""}.", + SerializedName = @"tokenBodyParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get; set; } + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth token endpoint. Contains absolute URI to entity being referenced.", + SerializedName = @"tokenEndpoint", + PossibleTypes = new [] { typeof(string) })] + string TokenEndpoint { get; set; } + + } + /// External OAuth authorization server Update settings contract. + internal partial interface IAuthorizationServerContractBasePropertiesInternal + + { + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get; set; } + /// Specifies the mechanism by which access token is passed to the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get; set; } + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get; set; } + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + string DefaultScope { get; set; } + /// Description of the authorization server. Can contain HTML formatting tags. + string Description { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + string ResourceOwnerPassword { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + string ResourceOwnerUsername { get; set; } + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + bool? SupportState { get; set; } + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get; set; } + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + string TokenEndpoint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractBaseProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractBaseProperties.json.cs new file mode 100644 index 000000000000..0ed1808a3f3f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractBaseProperties.json.cs @@ -0,0 +1,160 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server Update settings contract. + public partial class AuthorizationServerContractBaseProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationServerContractBaseProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_authorizationMethod = If( json?.PropertyT("authorizationMethods"), out var __jsonAuthorizationMethods) ? If( __jsonAuthorizationMethods as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod)""))) ))() : null : AuthorizationMethod;} + {_clientAuthenticationMethod = If( json?.PropertyT("clientAuthenticationMethod"), out var __jsonClientAuthenticationMethod) ? If( __jsonClientAuthenticationMethod as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod) (__p is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __o ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod)(__o.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod)""))) ))() : null : ClientAuthenticationMethod;} + {_tokenBodyParameter = If( json?.PropertyT("tokenBodyParameters"), out var __jsonTokenBodyParameters) ? If( __jsonTokenBodyParameters as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TokenBodyParameterContract.FromJson(__k) )) ))() : null : TokenBodyParameter;} + {_tokenEndpoint = If( json?.PropertyT("tokenEndpoint"), out var __jsonTokenEndpoint) ? (string)__jsonTokenEndpoint : (string)TokenEndpoint;} + {_supportState = If( json?.PropertyT("supportState"), out var __jsonSupportState) ? (bool?)__jsonSupportState : SupportState;} + {_defaultScope = If( json?.PropertyT("defaultScope"), out var __jsonDefaultScope) ? (string)__jsonDefaultScope : (string)DefaultScope;} + {_bearerTokenSendingMethod = If( json?.PropertyT("bearerTokenSendingMethods"), out var __jsonBearerTokenSendingMethods) ? If( __jsonBearerTokenSendingMethods as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod) (__f is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __e ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod)(__e.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod)""))) ))() : null : BearerTokenSendingMethod;} + {_resourceOwnerUsername = If( json?.PropertyT("resourceOwnerUsername"), out var __jsonResourceOwnerUsername) ? (string)__jsonResourceOwnerUsername : (string)ResourceOwnerUsername;} + {_resourceOwnerPassword = If( json?.PropertyT("resourceOwnerPassword"), out var __jsonResourceOwnerPassword) ? (string)__jsonResourceOwnerPassword : (string)ResourceOwnerPassword;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBaseProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBaseProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBaseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationServerContractBaseProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + if (null != this._authorizationMethod) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._authorizationMethod ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("authorizationMethods",__w); + } + if (null != this._clientAuthenticationMethod) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._clientAuthenticationMethod ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("clientAuthenticationMethod",__r); + } + if (null != this._tokenBodyParameter) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __n in this._tokenBodyParameter ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("tokenBodyParameters",__m); + } + AddIf( null != (((object)this._tokenEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._tokenEndpoint.ToString()) : null, "tokenEndpoint" ,container.Add ); + AddIf( null != this._supportState ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._supportState) : null, "supportState" ,container.Add ); + AddIf( null != (((object)this._defaultScope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._defaultScope.ToString()) : null, "defaultScope" ,container.Add ); + if (null != this._bearerTokenSendingMethod) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __i in this._bearerTokenSendingMethod ) + { + AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__i.ToString()) : null ,__h.Add); + } + container.Add("bearerTokenSendingMethods",__h); + } + AddIf( null != (((object)this._resourceOwnerUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceOwnerUsername.ToString()) : null, "resourceOwnerUsername" ,container.Add ); + AddIf( null != (((object)this._resourceOwnerPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceOwnerPassword.ToString()) : null, "resourceOwnerPassword" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractProperties.cs new file mode 100644 index 000000000000..bea7b3029ceb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractProperties.cs @@ -0,0 +1,295 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server settings Properties. + public partial class AuthorizationServerContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBaseProperties __authorizationServerContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContractBaseProperties(); + + /// Backing field for property. + private string _authorizationEndpoint; + + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AuthorizationEndpoint { get => this._authorizationEndpoint; set => this._authorizationEndpoint = value; } + + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).AuthorizationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).AuthorizationMethod = value ?? null /* arrayOf */; } + + /// Specifies the mechanism by which access token is passed to the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).BearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).BearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ClientAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ClientAuthenticationMethod = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _clientId; + + /// Client or app id registered with this authorization server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// Backing field for property. + private string _clientRegistrationEndpoint; + + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientRegistrationEndpoint { get => this._clientRegistrationEndpoint; set => this._clientRegistrationEndpoint = value; } + + /// Backing field for property. + private string _clientSecret; + + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientSecret { get => this._clientSecret; set => this._clientSecret = value; } + + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string DefaultScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).DefaultScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).DefaultScope = value ?? null; } + + /// Description of the authorization server. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// User-friendly authorization server name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] _grantType; + + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get => this._grantType; set => this._grantType = value; } + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ResourceOwnerPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerPassword = value ?? null; } + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ResourceOwnerUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerUsername = value ?? null; } + + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? SupportState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).SupportState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).SupportState = value ?? default(bool); } + + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenBodyParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenBodyParameter = value ?? null /* arrayOf */; } + + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string TokenEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenEndpoint = value ?? null; } + + /// Backing field for property. + private bool? _useInApiDocumentation; + + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? UseInApiDocumentation { get => this._useInApiDocumentation; set => this._useInApiDocumentation = value; } + + /// Backing field for property. + private bool? _useInTestConsole; + + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? UseInTestConsole { get => this._useInTestConsole; set => this._useInTestConsole = value; } + + /// Creates an new instance. + public AuthorizationServerContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__authorizationServerContractBaseProperties), __authorizationServerContractBaseProperties); + await eventListener.AssertObjectIsValid(nameof(__authorizationServerContractBaseProperties), __authorizationServerContractBaseProperties); + } + } + /// External OAuth authorization server settings Properties. + public partial interface IAuthorizationServerContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBaseProperties + { + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.", + SerializedName = @"authorizationEndpoint", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationEndpoint { get; set; } + /// Client or app id registered with this authorization server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Client or app id registered with this authorization server.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.", + SerializedName = @"clientRegistrationEndpoint", + PossibleTypes = new [] { typeof(string) })] + string ClientRegistrationEndpoint { get; set; } + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + /// User-friendly authorization server name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"User-friendly authorization server name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Form of an authorization grant, which the client uses to request the access token.", + SerializedName = @"grantTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get; set; } + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the authorization server will be used in the API documentation in the developer portal. False by default if no value is provided.", + SerializedName = @"useInApiDocumentation", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the authorization server may be used in the developer portal test console. True by default if no value is provided.", + SerializedName = @"useInTestConsole", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInTestConsole { get; set; } + + } + /// External OAuth authorization server settings Properties. + internal partial interface IAuthorizationServerContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal + { + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + string AuthorizationEndpoint { get; set; } + /// Client or app id registered with this authorization server. + string ClientId { get; set; } + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + string ClientRegistrationEndpoint { get; set; } + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + string ClientSecret { get; set; } + /// User-friendly authorization server name. + string DisplayName { get; set; } + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get; set; } + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + bool? UseInTestConsole { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractProperties.json.cs new file mode 100644 index 000000000000..6d6359be08ce --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerContractProperties.json.cs @@ -0,0 +1,133 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server settings Properties. + public partial class AuthorizationServerContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationServerContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __authorizationServerContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContractBaseProperties(json); + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_useInTestConsole = If( json?.PropertyT("useInTestConsole"), out var __jsonUseInTestConsole) ? (bool?)__jsonUseInTestConsole : UseInTestConsole;} + {_useInApiDocumentation = If( json?.PropertyT("useInApiDocumentation"), out var __jsonUseInApiDocumentation) ? (bool?)__jsonUseInApiDocumentation : UseInApiDocumentation;} + {_clientRegistrationEndpoint = If( json?.PropertyT("clientRegistrationEndpoint"), out var __jsonClientRegistrationEndpoint) ? (string)__jsonClientRegistrationEndpoint : (string)ClientRegistrationEndpoint;} + {_authorizationEndpoint = If( json?.PropertyT("authorizationEndpoint"), out var __jsonAuthorizationEndpoint) ? (string)__jsonAuthorizationEndpoint : (string)AuthorizationEndpoint;} + {_grantType = If( json?.PropertyT("grantTypes"), out var __jsonGrantTypes) ? If( __jsonGrantTypes as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType)""))) ))() : null : GrantType;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationServerContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __authorizationServerContractBaseProperties?.ToJson(container, serializationMode); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != this._useInTestConsole ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._useInTestConsole) : null, "useInTestConsole" ,container.Add ); + AddIf( null != this._useInApiDocumentation ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._useInApiDocumentation) : null, "useInApiDocumentation" ,container.Add ); + AddIf( null != (((object)this._clientRegistrationEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientRegistrationEndpoint.ToString()) : null, "clientRegistrationEndpoint" ,container.Add ); + AddIf( null != (((object)this._authorizationEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._authorizationEndpoint.ToString()) : null, "authorizationEndpoint" ,container.Add ); + if (null != this._grantType) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._grantType ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("grantTypes",__w); + } + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AddIf( null != (((object)this._clientSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientSecret.ToString()) : null, "clientSecret" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerSecretsContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerSecretsContract.cs new file mode 100644 index 000000000000..91840985e78e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerSecretsContract.cs @@ -0,0 +1,129 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth Server Secrets Contract. + public partial class AuthorizationServerSecretsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerSecretsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerSecretsContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _clientSecret; + + /// oAuth Authorization Server Secrets. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientSecret { get => this._clientSecret; set => this._clientSecret = value; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Backing field for property. + private string _resourceOwnerPassword; + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceOwnerPassword { get => this._resourceOwnerPassword; set => this._resourceOwnerPassword = value; } + + /// Backing field for property. + private string _resourceOwnerUsername; + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceOwnerUsername { get => this._resourceOwnerUsername; set => this._resourceOwnerUsername = value; } + + /// Creates an new instance. + public AuthorizationServerSecretsContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerSecretsContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + /// OAuth Server Secrets Contract. + public partial interface IAuthorizationServerSecretsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// oAuth Authorization Server Secrets. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"oAuth Authorization Server Secrets.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.", + SerializedName = @"resourceOwnerPassword", + PossibleTypes = new [] { typeof(string) })] + string ResourceOwnerPassword { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.", + SerializedName = @"resourceOwnerUsername", + PossibleTypes = new [] { typeof(string) })] + string ResourceOwnerUsername { get; set; } + + } + /// OAuth Server Secrets Contract. + internal partial interface IAuthorizationServerSecretsContractInternal + + { + /// oAuth Authorization Server Secrets. + string ClientSecret { get; set; } + + string ETag { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + string ResourceOwnerPassword { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + string ResourceOwnerUsername { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerSecretsContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerSecretsContract.json.cs new file mode 100644 index 000000000000..db9e9cba25a0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerSecretsContract.json.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth Server Secrets Contract. + public partial class AuthorizationServerSecretsContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationServerSecretsContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} + {_resourceOwnerUsername = If( json?.PropertyT("resourceOwnerUsername"), out var __jsonResourceOwnerUsername) ? (string)__jsonResourceOwnerUsername : (string)ResourceOwnerUsername;} + {_resourceOwnerPassword = If( json?.PropertyT("resourceOwnerPassword"), out var __jsonResourceOwnerPassword) ? (string)__jsonResourceOwnerPassword : (string)ResourceOwnerPassword;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerSecretsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerSecretsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerSecretsContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationServerSecretsContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._clientSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientSecret.ToString()) : null, "clientSecret" ,container.Add ); + AddIf( null != (((object)this._resourceOwnerUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceOwnerUsername.ToString()) : null, "resourceOwnerUsername" ,container.Add ); + AddIf( null != (((object)this._resourceOwnerPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceOwnerPassword.ToString()) : null, "resourceOwnerPassword" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContract.cs new file mode 100644 index 000000000000..7c2d642ef5b9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContract.cs @@ -0,0 +1,449 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server settings. + public partial class AuthorizationServerUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string AuthorizationEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).AuthorizationEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).AuthorizationEndpoint = value ?? null; } + + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).AuthorizationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).AuthorizationMethod = value ?? null /* arrayOf */; } + + /// Specifies the mechanism by which access token is passed to the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).BearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).BearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ClientAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ClientAuthenticationMethod = value ?? null /* arrayOf */; } + + /// Client or app id registered with this authorization server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).ClientId = value ?? null; } + + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientRegistrationEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).ClientRegistrationEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).ClientRegistrationEndpoint = value ?? null; } + + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).ClientSecret = value ?? null; } + + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DefaultScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).DefaultScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).DefaultScope = value ?? null; } + + /// Description of the authorization server. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).Description = value ?? null; } + + /// User-friendly authorization server name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).GrantType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).GrantType = value ?? null /* arrayOf */; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerUpdateContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractProperties _property; + + /// Properties of the External OAuth authorization server update Contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerUpdateContractProperties()); set => this._property = value; } + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResourceOwnerPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerPassword = value ?? null; } + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResourceOwnerUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).ResourceOwnerUsername = value ?? null; } + + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SupportState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).SupportState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).SupportState = value ?? default(bool); } + + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).TokenBodyParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).TokenBodyParameter = value ?? null /* arrayOf */; } + + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TokenEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).TokenEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)Property).TokenEndpoint = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UseInApiDocumentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).UseInApiDocumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).UseInApiDocumentation = value ?? default(bool); } + + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UseInTestConsole { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).UseInTestConsole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal)Property).UseInTestConsole = value ?? default(bool); } + + /// Creates an new instance. + public AuthorizationServerUpdateContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// External OAuth authorization server settings. + public partial interface IAuthorizationServerUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.", + SerializedName = @"authorizationEndpoint", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationEndpoint { get; set; } + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.", + SerializedName = @"authorizationMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get; set; } + /// Specifies the mechanism by which access token is passed to the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the mechanism by which access token is passed to the API. ", + SerializedName = @"bearerTokenSendingMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get; set; } + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format.", + SerializedName = @"clientAuthenticationMethod", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get; set; } + /// Client or app id registered with this authorization server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client or app id registered with this authorization server.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.", + SerializedName = @"clientRegistrationEndpoint", + PossibleTypes = new [] { typeof(string) })] + string ClientRegistrationEndpoint { get; set; } + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values.", + SerializedName = @"defaultScope", + PossibleTypes = new [] { typeof(string) })] + string DefaultScope { get; set; } + /// Description of the authorization server. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the authorization server. Can contain HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// User-friendly authorization server name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-friendly authorization server name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Form of an authorization grant, which the client uses to request the access token.", + SerializedName = @"grantTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.", + SerializedName = @"resourceOwnerPassword", + PossibleTypes = new [] { typeof(string) })] + string ResourceOwnerPassword { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.", + SerializedName = @"resourceOwnerUsername", + PossibleTypes = new [] { typeof(string) })] + string ResourceOwnerUsername { get; set; } + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security.", + SerializedName = @"supportState", + PossibleTypes = new [] { typeof(bool) })] + bool? SupportState { get; set; } + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {""name"" : ""name value"", ""value"": ""a value""}.", + SerializedName = @"tokenBodyParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get; set; } + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth token endpoint. Contains absolute URI to entity being referenced.", + SerializedName = @"tokenEndpoint", + PossibleTypes = new [] { typeof(string) })] + string TokenEndpoint { get; set; } + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the authorization server will be used in the API documentation in the developer portal. False by default if no value is provided.", + SerializedName = @"useInApiDocumentation", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the authorization server may be used in the developer portal test console. True by default if no value is provided.", + SerializedName = @"useInTestConsole", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInTestConsole { get; set; } + + } + /// External OAuth authorization server settings. + internal partial interface IAuthorizationServerUpdateContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + string AuthorizationEndpoint { get; set; } + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get; set; } + /// Specifies the mechanism by which access token is passed to the API. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get; set; } + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get; set; } + /// Client or app id registered with this authorization server. + string ClientId { get; set; } + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + string ClientRegistrationEndpoint { get; set; } + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + string ClientSecret { get; set; } + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + string DefaultScope { get; set; } + /// Description of the authorization server. Can contain HTML formatting tags. + string Description { get; set; } + /// User-friendly authorization server name. + string DisplayName { get; set; } + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get; set; } + /// Properties of the External OAuth authorization server update Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractProperties Property { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + string ResourceOwnerPassword { get; set; } + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + string ResourceOwnerUsername { get; set; } + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + bool? SupportState { get; set; } + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get; set; } + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + string TokenEndpoint { get; set; } + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + bool? UseInTestConsole { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContract.json.cs new file mode 100644 index 000000000000..510690ae82ee --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server settings. + public partial class AuthorizationServerUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationServerUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerUpdateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationServerUpdateContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContractProperties.cs new file mode 100644 index 000000000000..6966336330d6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContractProperties.cs @@ -0,0 +1,297 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server Update settings contract. + public partial class AuthorizationServerUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBaseProperties __authorizationServerContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContractBaseProperties(); + + /// Backing field for property. + private string _authorizationEndpoint; + + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AuthorizationEndpoint { get => this._authorizationEndpoint; set => this._authorizationEndpoint = value; } + + /// + /// HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod[] AuthorizationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).AuthorizationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).AuthorizationMethod = value ?? null /* arrayOf */; } + + /// Specifies the mechanism by which access token is passed to the API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod[] BearerTokenSendingMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).BearerTokenSendingMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).BearerTokenSendingMethod = value ?? null /* arrayOf */; } + + /// + /// Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or + /// Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded + /// format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod[] ClientAuthenticationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ClientAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ClientAuthenticationMethod = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _clientId; + + /// Client or app id registered with this authorization server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// Backing field for property. + private string _clientRegistrationEndpoint; + + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientRegistrationEndpoint { get => this._clientRegistrationEndpoint; set => this._clientRegistrationEndpoint = value; } + + /// Backing field for property. + private string _clientSecret; + + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientSecret { get => this._clientSecret; set => this._clientSecret = value; } + + /// + /// Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in + /// the form of a string containing space-delimited values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string DefaultScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).DefaultScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).DefaultScope = value ?? null; } + + /// Description of the authorization server. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// User-friendly authorization server name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] _grantType; + + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get => this._grantType; set => this._grantType = value; } + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ResourceOwnerPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerPassword = value ?? null; } + + /// + /// Can be optionally specified when resource owner password grant type is supported by this authorization server. Default + /// resource owner username. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ResourceOwnerUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).ResourceOwnerUsername = value ?? null; } + + /// + /// If true, authorization server will include state parameter from the authorization request to its response. Client may + /// use state parameter to raise protocol security. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? SupportState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).SupportState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).SupportState = value ?? default(bool); } + + /// + /// Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects + /// with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract[] TokenBodyParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenBodyParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenBodyParameter = value ?? null /* arrayOf */; } + + /// OAuth token endpoint. Contains absolute URI to entity being referenced. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string TokenEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal)__authorizationServerContractBaseProperties).TokenEndpoint = value ?? null; } + + /// Backing field for property. + private bool? _useInApiDocumentation; + + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? UseInApiDocumentation { get => this._useInApiDocumentation; set => this._useInApiDocumentation = value; } + + /// Backing field for property. + private bool? _useInTestConsole; + + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? UseInTestConsole { get => this._useInTestConsole; set => this._useInTestConsole = value; } + + /// + /// Creates an new instance. + /// + public AuthorizationServerUpdateContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__authorizationServerContractBaseProperties), __authorizationServerContractBaseProperties); + await eventListener.AssertObjectIsValid(nameof(__authorizationServerContractBaseProperties), __authorizationServerContractBaseProperties); + } + } + /// External OAuth authorization server Update settings contract. + public partial interface IAuthorizationServerUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBaseProperties + { + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.", + SerializedName = @"authorizationEndpoint", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationEndpoint { get; set; } + /// Client or app id registered with this authorization server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client or app id registered with this authorization server.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.", + SerializedName = @"clientRegistrationEndpoint", + PossibleTypes = new [] { typeof(string) })] + string ClientRegistrationEndpoint { get; set; } + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + /// User-friendly authorization server name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-friendly authorization server name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Form of an authorization grant, which the client uses to request the access token.", + SerializedName = @"grantTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get; set; } + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the authorization server will be used in the API documentation in the developer portal. False by default if no value is provided.", + SerializedName = @"useInApiDocumentation", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the authorization server may be used in the developer portal test console. True by default if no value is provided.", + SerializedName = @"useInTestConsole", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInTestConsole { get; set; } + + } + /// External OAuth authorization server Update settings contract. + internal partial interface IAuthorizationServerUpdateContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerContractBasePropertiesInternal + { + /// + /// OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. + /// + string AuthorizationEndpoint { get; set; } + /// Client or app id registered with this authorization server. + string ClientId { get; set; } + /// + /// Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute + /// URL to entity being referenced. + /// + string ClientRegistrationEndpoint { get; set; } + /// + /// Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! + /// Use '/listSecrets' POST request to get the value. + /// + string ClientSecret { get; set; } + /// User-friendly authorization server name. + string DisplayName { get; set; } + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType[] GrantType { get; set; } + /// + /// If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + /// value is provided. + /// + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + /// + bool? UseInTestConsole { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContractProperties.json.cs new file mode 100644 index 000000000000..7cf6a01812bb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/AuthorizationServerUpdateContractProperties.json.cs @@ -0,0 +1,134 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// External OAuth authorization server Update settings contract. + public partial class AuthorizationServerUpdateContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationServerUpdateContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __authorizationServerContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.AuthorizationServerContractBaseProperties(json); + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_useInTestConsole = If( json?.PropertyT("useInTestConsole"), out var __jsonUseInTestConsole) ? (bool?)__jsonUseInTestConsole : UseInTestConsole;} + {_useInApiDocumentation = If( json?.PropertyT("useInApiDocumentation"), out var __jsonUseInApiDocumentation) ? (bool?)__jsonUseInApiDocumentation : UseInApiDocumentation;} + {_clientRegistrationEndpoint = If( json?.PropertyT("clientRegistrationEndpoint"), out var __jsonClientRegistrationEndpoint) ? (string)__jsonClientRegistrationEndpoint : (string)ClientRegistrationEndpoint;} + {_authorizationEndpoint = If( json?.PropertyT("authorizationEndpoint"), out var __jsonAuthorizationEndpoint) ? (string)__jsonAuthorizationEndpoint : (string)AuthorizationEndpoint;} + {_grantType = If( json?.PropertyT("grantTypes"), out var __jsonGrantTypes) ? If( __jsonGrantTypes as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType)""))) ))() : null : GrantType;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IAuthorizationServerUpdateContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationServerUpdateContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __authorizationServerContractBaseProperties?.ToJson(container, serializationMode); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != this._useInTestConsole ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._useInTestConsole) : null, "useInTestConsole" ,container.Add ); + AddIf( null != this._useInApiDocumentation ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._useInApiDocumentation) : null, "useInApiDocumentation" ,container.Add ); + AddIf( null != (((object)this._clientRegistrationEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientRegistrationEndpoint.ToString()) : null, "clientRegistrationEndpoint" ,container.Add ); + AddIf( null != (((object)this._authorizationEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._authorizationEndpoint.ToString()) : null, "authorizationEndpoint" ,container.Add ); + if (null != this._grantType) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._grantType ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("grantTypes",__w); + } + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AddIf( null != (((object)this._clientSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientSecret.ToString()) : null, "clientSecret" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendAuthorizationHeaderCredentials.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendAuthorizationHeaderCredentials.cs new file mode 100644 index 000000000000..54d30da74a7e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendAuthorizationHeaderCredentials.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization header information. + public partial class BackendAuthorizationHeaderCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentialsInternal + { + + /// Backing field for property. + private string _parameter; + + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Parameter { get => this._parameter; set => this._parameter = value; } + + /// Backing field for property. + private string _scheme; + + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Scheme { get => this._scheme; set => this._scheme = value; } + + /// Creates an new instance. + public BackendAuthorizationHeaderCredentials() + { + + } + } + /// Authorization header information. + public partial interface IBackendAuthorizationHeaderCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Authentication Parameter value.", + SerializedName = @"parameter", + PossibleTypes = new [] { typeof(string) })] + string Parameter { get; set; } + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Authentication Scheme name.", + SerializedName = @"scheme", + PossibleTypes = new [] { typeof(string) })] + string Scheme { get; set; } + + } + /// Authorization header information. + internal partial interface IBackendAuthorizationHeaderCredentialsInternal + + { + /// Authentication Parameter value. + string Parameter { get; set; } + /// Authentication Scheme name. + string Scheme { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendAuthorizationHeaderCredentials.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendAuthorizationHeaderCredentials.json.cs new file mode 100644 index 000000000000..d13f49cb9cad --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendAuthorizationHeaderCredentials.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Authorization header information. + public partial class BackendAuthorizationHeaderCredentials + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendAuthorizationHeaderCredentials(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_scheme = If( json?.PropertyT("scheme"), out var __jsonScheme) ? (string)__jsonScheme : (string)Scheme;} + {_parameter = If( json?.PropertyT("parameter"), out var __jsonParameter) ? (string)__jsonParameter : (string)Parameter;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendAuthorizationHeaderCredentials(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._scheme)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._scheme.ToString()) : null, "scheme" ,container.Add ); + AddIf( null != (((object)this._parameter)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._parameter.ToString()) : null, "parameter" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParameters.cs new file mode 100644 index 000000000000..314b4cdf10d7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParameters.cs @@ -0,0 +1,503 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend entity base Parameter set. + public partial class BackendBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal + { + + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string AuthorizationParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).AuthorizationParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).AuthorizationParameter = value ?? null; } + + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string AuthorizationScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).AuthorizationScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).AuthorizationScheme = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker _circuitBreaker; + + /// Backend Circuit Breaker Configuration + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker CircuitBreaker { get => (this._circuitBreaker = this._circuitBreaker ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCircuitBreaker()); set => this._circuitBreaker = value; } + + /// The rules for tripping the backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreakerInternal)CircuitBreaker).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreakerInternal)CircuitBreaker).Rule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract _credentials; + + /// Backend Credentials Contract Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract Credentials { get => (this._credentials = this._credentials ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCredentialsContract()); set => this._credentials = value; } + + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CredentialsCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).Certificate = value ?? null /* arrayOf */; } + + /// List of Client Certificate Ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CredentialsCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).CertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).CertificateId = value ?? null /* arrayOf */; } + + /// Header Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).Header = value ?? null /* model class */; } + + /// Query Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).Query; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).Query = value ?? null /* model class */; } + + /// Backing field for property. + private string _description; + + /// Backend Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Internal Acessors for CircuitBreaker + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal.CircuitBreaker { get => (this._circuitBreaker = this._circuitBreaker ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCircuitBreaker()); set { {_circuitBreaker = value;} } } + + /// Internal Acessors for Credentials + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal.Credentials { get => (this._credentials = this._credentials ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCredentialsContract()); set { {_credentials = value;} } } + + /// Internal Acessors for CredentialsAuthorization + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal.CredentialsAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).Authorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal)Credentials).Authorization = value; } + + /// Internal Acessors for Pool + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal.Pool { get => (this._pool = this._pool ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendBaseParametersPool()); set { {_pool = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendProperties()); set { {_property = value;} } } + + /// Internal Acessors for Proxy + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal.Proxy { get => (this._proxy = this._proxy ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendProxyContract()); set { {_proxy = value;} } } + + /// Internal Acessors for ServiceFabricCluster + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal.ServiceFabricCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricCluster = value; } + + /// Internal Acessors for Tl + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal.Tl { get => (this._tl = this._tl ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendTlsProperties()); set { {_tl = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool _pool; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool Pool { get => (this._pool = this._pool ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendBaseParametersPool()); set => this._pool = value; } + + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolInternal)Pool).Service; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolInternal)Pool).Service = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties _property; + + /// Backend Properties contract + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract _proxy; + + /// Backend gateway Contract Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract Proxy { get => (this._proxy = this._proxy ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendProxyContract()); set => this._proxy = value; } + + /// Password to connect to the WebProxy Server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProxyPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContractInternal)Proxy).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContractInternal)Proxy).Password = value ?? null; } + + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProxyUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContractInternal)Proxy).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContractInternal)Proxy).Url = value ?? null; } + + /// Username to connect to the WebProxy server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProxyUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContractInternal)Proxy).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContractInternal)Proxy).Username = value ?? null; } + + /// Backing field for property. + private string _resourceId; + + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceFabricClusterClientCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterClientCertificateId = value ?? null; } + + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceFabricClusterClientCertificatethumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterClientCertificatethumbprint = value ?? null; } + + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] ServiceFabricClusterManagementEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterManagementEndpoint = value ?? null /* arrayOf */; } + + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? ServiceFabricClusterMaxPartitionResolutionRetry { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterMaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterMaxPartitionResolutionRetry = value ?? default(int); } + + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] ServiceFabricClusterServerCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterServerCertificateThumbprint = value ?? null /* arrayOf */; } + + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal)Property).ServiceFabricClusterServerX509Name = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _title; + + /// Backend Title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties _tl; + + /// Backend TLS Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties Tl { get => (this._tl = this._tl ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendTlsProperties()); set => this._tl = value; } + + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TlValidateCertificateChain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsPropertiesInternal)Tl).ValidateCertificateChain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsPropertiesInternal)Tl).ValidateCertificateChain = value ?? default(bool); } + + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TlValidateCertificateName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsPropertiesInternal)Tl).ValidateCertificateName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsPropertiesInternal)Tl).ValidateCertificateName = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? _type; + + /// Type of the backend. A backend can be either Single or Pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public BackendBaseParameters() + { + + } + } + /// Backend entity base Parameter set. + public partial interface IBackendBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication Parameter value.", + SerializedName = @"parameter", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationParameter { get; set; } + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication Scheme name.", + SerializedName = @"scheme", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationScheme { get; set; } + /// The rules for tripping the backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The rules for tripping the backend.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get; set; } + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided.", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + string[] CredentialsCertificate { get; set; } + /// List of Client Certificate Ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Client Certificate Ids.", + SerializedName = @"certificateIds", + PossibleTypes = new [] { typeof(string) })] + string[] CredentialsCertificateId { get; set; } + /// Header Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Header Parameter description.", + SerializedName = @"header", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get; set; } + /// Query Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query Parameter description.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get; set; } + /// Backend Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backend Description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of backend entities belonging to a pool.", + SerializedName = @"services", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get; set; } + /// Password to connect to the WebProxy Server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to the WebProxy Server", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ProxyPassword { get; set; } + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string ProxyUrl { get; set; } + /// Username to connect to the WebProxy server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to connect to the WebProxy server", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string ProxyUsername { get; set; } + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or API Apps.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client certificate id for the management endpoint.", + SerializedName = @"clientCertificateId", + PossibleTypes = new [] { typeof(string) })] + string ServiceFabricClusterClientCertificateId { get; set; } + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided", + SerializedName = @"clientCertificatethumbprint", + PossibleTypes = new [] { typeof(string) })] + string ServiceFabricClusterClientCertificatethumbprint { get; set; } + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster management endpoint.", + SerializedName = @"managementEndpoints", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceFabricClusterManagementEndpoint { get; set; } + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of retries while attempting resolve the partition.", + SerializedName = @"maxPartitionResolutionRetries", + PossibleTypes = new [] { typeof(int) })] + int? ServiceFabricClusterMaxPartitionResolutionRetry { get; set; } + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprints of certificates cluster management service uses for tls communication", + SerializedName = @"serverCertificateThumbprints", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceFabricClusterServerCertificateThumbprint { get; set; } + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server X509 Certificate Names Collection", + SerializedName = @"serverX509Names", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + /// Backend Title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backend Title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host.", + SerializedName = @"validateCertificateChain", + PossibleTypes = new [] { typeof(bool) })] + bool? TlValidateCertificateChain { get; set; } + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host.", + SerializedName = @"validateCertificateName", + PossibleTypes = new [] { typeof(bool) })] + bool? TlValidateCertificateName { get; set; } + /// Type of the backend. A backend can be either Single or Pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the backend. A backend can be either Single or Pool.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? Type { get; set; } + + } + /// Backend entity base Parameter set. + internal partial interface IBackendBaseParametersInternal + + { + /// Authentication Parameter value. + string AuthorizationParameter { get; set; } + /// Authentication Scheme name. + string AuthorizationScheme { get; set; } + /// Backend Circuit Breaker Configuration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker CircuitBreaker { get; set; } + /// The rules for tripping the backend. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get; set; } + /// Backend Credentials Contract Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract Credentials { get; set; } + /// Authorization header authentication + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials CredentialsAuthorization { get; set; } + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + string[] CredentialsCertificate { get; set; } + /// List of Client Certificate Ids. + string[] CredentialsCertificateId { get; set; } + /// Header Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get; set; } + /// Query Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get; set; } + /// Backend Description. + string Description { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool Pool { get; set; } + /// The list of backend entities belonging to a pool. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get; set; } + /// Backend Properties contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties Property { get; set; } + /// Backend gateway Contract Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract Proxy { get; set; } + /// Password to connect to the WebProxy Server + string ProxyPassword { get; set; } + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + string ProxyUrl { get; set; } + /// Username to connect to the WebProxy server + string ProxyUsername { get; set; } + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + string ResourceId { get; set; } + /// Backend Service Fabric Cluster Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties ServiceFabricCluster { get; set; } + /// The client certificate id for the management endpoint. + string ServiceFabricClusterClientCertificateId { get; set; } + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + string ServiceFabricClusterClientCertificatethumbprint { get; set; } + /// The cluster management endpoint. + string[] ServiceFabricClusterManagementEndpoint { get; set; } + /// Maximum number of retries while attempting resolve the partition. + int? ServiceFabricClusterMaxPartitionResolutionRetry { get; set; } + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + string[] ServiceFabricClusterServerCertificateThumbprint { get; set; } + /// Server X509 Certificate Names Collection + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + /// Backend Title. + string Title { get; set; } + /// Backend TLS Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties Tl { get; set; } + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + bool? TlValidateCertificateChain { get; set; } + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + bool? TlValidateCertificateName { get; set; } + /// Type of the backend. A backend can be either Single or Pool. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParameters.json.cs new file mode 100644 index 000000000000..509250179f07 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParameters.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend entity base Parameter set. + public partial class BackendBaseParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendBaseParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendProperties.FromJson(__jsonProperties) : Property;} + {_credentials = If( json?.PropertyT("credentials"), out var __jsonCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCredentialsContract.FromJson(__jsonCredentials) : Credentials;} + {_proxy = If( json?.PropertyT("proxy"), out var __jsonProxy) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendProxyContract.FromJson(__jsonProxy) : Proxy;} + {_tl = If( json?.PropertyT("tls"), out var __jsonTls) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendTlsProperties.FromJson(__jsonTls) : Tl;} + {_circuitBreaker = If( json?.PropertyT("circuitBreaker"), out var __jsonCircuitBreaker) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCircuitBreaker.FromJson(__jsonCircuitBreaker) : CircuitBreaker;} + {_pool = If( json?.PropertyT("pool"), out var __jsonPool) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendBaseParametersPool.FromJson(__jsonPool) : Pool;} + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendBaseParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._credentials ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._credentials.ToJson(null,serializationMode) : null, "credentials" ,container.Add ); + AddIf( null != this._proxy ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._proxy.ToJson(null,serializationMode) : null, "proxy" ,container.Add ); + AddIf( null != this._tl ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._tl.ToJson(null,serializationMode) : null, "tls" ,container.Add ); + AddIf( null != this._circuitBreaker ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._circuitBreaker.ToJson(null,serializationMode) : null, "circuitBreaker" ,container.Add ); + AddIf( null != this._pool ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._pool.ToJson(null,serializationMode) : null, "pool" ,container.Add ); + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParametersPool.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParametersPool.cs new file mode 100644 index 000000000000..7d861909033c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParametersPool.cs @@ -0,0 +1,54 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class BackendBaseParametersPool : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPoolInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPool __backendPool = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendPool(); + + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] Service { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolInternal)__backendPool).Service; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolInternal)__backendPool).Service = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public BackendBaseParametersPool() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__backendPool), __backendPool); + await eventListener.AssertObjectIsValid(nameof(__backendPool), __backendPool); + } + } + public partial interface IBackendBaseParametersPool : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPool + { + + } + internal partial interface IBackendBaseParametersPoolInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParametersPool.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParametersPool.json.cs new file mode 100644 index 000000000000..7c06807c034f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendBaseParametersPool.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class BackendBaseParametersPool + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendBaseParametersPool(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __backendPool = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendPool(json); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendBaseParametersPool(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __backendPool?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCircuitBreaker.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCircuitBreaker.cs new file mode 100644 index 000000000000..02067e47a675 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCircuitBreaker.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The configuration of the backend circuit breaker + public partial class BackendCircuitBreaker : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreakerInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] _rule; + + /// The rules for tripping the backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] Rule { get => this._rule; set => this._rule = value; } + + /// Creates an new instance. + public BackendCircuitBreaker() + { + + } + } + /// The configuration of the backend circuit breaker + public partial interface IBackendCircuitBreaker : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The rules for tripping the backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The rules for tripping the backend.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] Rule { get; set; } + + } + /// The configuration of the backend circuit breaker + internal partial interface IBackendCircuitBreakerInternal + + { + /// The rules for tripping the backend. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] Rule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCircuitBreaker.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCircuitBreaker.json.cs new file mode 100644 index 000000000000..37a8ab95e7e8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCircuitBreaker.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The configuration of the backend circuit breaker + public partial class BackendCircuitBreaker + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendCircuitBreaker(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CircuitBreakerRule.FromJson(__u) )) ))() : null : Rule;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendCircuitBreaker(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._rule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._rule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("rules",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCollection.cs new file mode 100644 index 000000000000..dadf68e2b894 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Backend list representation. + public partial class BackendCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract[] _value; + + /// Backend values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public BackendCollection() + { + + } + } + /// Paged Backend list representation. + public partial interface IBackendCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Backend values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backend values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract[] Value { get; set; } + + } + /// Paged Backend list representation. + internal partial interface IBackendCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Backend values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCollection.json.cs new file mode 100644 index 000000000000..5c67b85611e6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Backend list representation. + public partial class BackendCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContract.cs new file mode 100644 index 000000000000..13af62a7ac27 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContract.cs @@ -0,0 +1,559 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend details. + public partial class BackendContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string AuthorizationParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).AuthorizationParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).AuthorizationParameter = value ?? null; } + + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string AuthorizationScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).AuthorizationScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).AuthorizationScheme = value ?? null; } + + /// The rules for tripping the backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CircuitBreakerRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CircuitBreakerRule = value ?? null /* arrayOf */; } + + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CredentialsCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsCertificate = value ?? null /* arrayOf */; } + + /// List of Client Certificate Ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CredentialsCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsCertificateId = value ?? null /* arrayOf */; } + + /// Header Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsHeader = value ?? null /* model class */; } + + /// Query Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsQuery = value ?? null /* model class */; } + + /// Backend Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Description = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for BackendProperty + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal.BackendProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Property = value; } + + /// Internal Acessors for CircuitBreaker + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal.CircuitBreaker { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CircuitBreaker; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CircuitBreaker = value; } + + /// Internal Acessors for Credentials + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal.Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Credentials = value; } + + /// Internal Acessors for CredentialsAuthorization + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal.CredentialsAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsAuthorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsAuthorization = value; } + + /// Internal Acessors for Pool + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal.Pool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Pool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Pool = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Proxy + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal.Proxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Proxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Proxy = value; } + + /// Internal Acessors for ServiceFabricCluster + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal.ServiceFabricCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricCluster = value; } + + /// Internal Acessors for Tl + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal.Tl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Tl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Tl = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).PoolService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).PoolService = value ?? null /* arrayOf */; } + + /// Type of the backend. A backend can be either Single or Pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? PropertiesType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractProperties _property; + + /// Backend entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendContractProperties()); set => this._property = value; } + + /// Backend communication protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol? Protocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractPropertiesInternal)Property).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractPropertiesInternal)Property).Protocol = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol)""); } + + /// Password to connect to the WebProxy Server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProxyPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyPassword = value ?? null; } + + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProxyUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyUrl = value ?? null; } + + /// Username to connect to the WebProxy server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProxyUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyUsername = value ?? null; } + + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ResourceId = value ?? null; } + + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceFabricClusterClientCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificateId = value ?? null; } + + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceFabricClusterClientCertificatethumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificatethumbprint = value ?? null; } + + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] ServiceFabricClusterManagementEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterManagementEndpoint = value ?? null /* arrayOf */; } + + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? ServiceFabricClusterMaxPartitionResolutionRetry { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterMaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterMaxPartitionResolutionRetry = value ?? default(int); } + + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] ServiceFabricClusterServerCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerCertificateThumbprint = value ?? null /* arrayOf */; } + + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerX509Name = value ?? null /* arrayOf */; } + + /// Backend Title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Title = value ?? null; } + + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TlValidateCertificateChain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).TlValidateCertificateChain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).TlValidateCertificateChain = value ?? default(bool); } + + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TlValidateCertificateName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).TlValidateCertificateName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).TlValidateCertificateName = value ?? default(bool); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Runtime Url of the Backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Url { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractPropertiesInternal)Property).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractPropertiesInternal)Property).Url = value ?? null; } + + /// Creates an new instance. + public BackendContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Backend details. + public partial interface IBackendContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication Parameter value.", + SerializedName = @"parameter", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationParameter { get; set; } + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication Scheme name.", + SerializedName = @"scheme", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationScheme { get; set; } + /// The rules for tripping the backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The rules for tripping the backend.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get; set; } + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided.", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + string[] CredentialsCertificate { get; set; } + /// List of Client Certificate Ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Client Certificate Ids.", + SerializedName = @"certificateIds", + PossibleTypes = new [] { typeof(string) })] + string[] CredentialsCertificateId { get; set; } + /// Header Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Header Parameter description.", + SerializedName = @"header", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get; set; } + /// Query Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query Parameter description.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get; set; } + /// Backend Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backend Description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of backend entities belonging to a pool.", + SerializedName = @"services", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get; set; } + /// Type of the backend. A backend can be either Single or Pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the backend. A backend can be either Single or Pool.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? PropertiesType { get; set; } + /// Backend communication protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backend communication protocol.", + SerializedName = @"protocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol? Protocol { get; set; } + /// Password to connect to the WebProxy Server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to the WebProxy Server", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ProxyPassword { get; set; } + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string ProxyUrl { get; set; } + /// Username to connect to the WebProxy server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to connect to the WebProxy server", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string ProxyUsername { get; set; } + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or API Apps.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client certificate id for the management endpoint.", + SerializedName = @"clientCertificateId", + PossibleTypes = new [] { typeof(string) })] + string ServiceFabricClusterClientCertificateId { get; set; } + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided", + SerializedName = @"clientCertificatethumbprint", + PossibleTypes = new [] { typeof(string) })] + string ServiceFabricClusterClientCertificatethumbprint { get; set; } + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster management endpoint.", + SerializedName = @"managementEndpoints", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceFabricClusterManagementEndpoint { get; set; } + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of retries while attempting resolve the partition.", + SerializedName = @"maxPartitionResolutionRetries", + PossibleTypes = new [] { typeof(int) })] + int? ServiceFabricClusterMaxPartitionResolutionRetry { get; set; } + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprints of certificates cluster management service uses for tls communication", + SerializedName = @"serverCertificateThumbprints", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceFabricClusterServerCertificateThumbprint { get; set; } + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server X509 Certificate Names Collection", + SerializedName = @"serverX509Names", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + /// Backend Title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backend Title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host.", + SerializedName = @"validateCertificateChain", + PossibleTypes = new [] { typeof(bool) })] + bool? TlValidateCertificateChain { get; set; } + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host.", + SerializedName = @"validateCertificateName", + PossibleTypes = new [] { typeof(bool) })] + bool? TlValidateCertificateName { get; set; } + /// Runtime Url of the Backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Runtime Url of the Backend.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + + } + /// Backend details. + internal partial interface IBackendContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Authentication Parameter value. + string AuthorizationParameter { get; set; } + /// Authentication Scheme name. + string AuthorizationScheme { get; set; } + /// Backend Properties contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties BackendProperty { get; set; } + /// Backend Circuit Breaker Configuration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker CircuitBreaker { get; set; } + /// The rules for tripping the backend. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get; set; } + /// Backend Credentials Contract Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract Credentials { get; set; } + /// Authorization header authentication + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials CredentialsAuthorization { get; set; } + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + string[] CredentialsCertificate { get; set; } + /// List of Client Certificate Ids. + string[] CredentialsCertificateId { get; set; } + /// Header Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get; set; } + /// Query Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get; set; } + /// Backend Description. + string Description { get; set; } + + string ETag { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool Pool { get; set; } + /// The list of backend entities belonging to a pool. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get; set; } + /// Type of the backend. A backend can be either Single or Pool. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? PropertiesType { get; set; } + /// Backend entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractProperties Property { get; set; } + /// Backend communication protocol. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol? Protocol { get; set; } + /// Backend gateway Contract Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract Proxy { get; set; } + /// Password to connect to the WebProxy Server + string ProxyPassword { get; set; } + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + string ProxyUrl { get; set; } + /// Username to connect to the WebProxy server + string ProxyUsername { get; set; } + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + string ResourceId { get; set; } + /// Backend Service Fabric Cluster Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties ServiceFabricCluster { get; set; } + /// The client certificate id for the management endpoint. + string ServiceFabricClusterClientCertificateId { get; set; } + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + string ServiceFabricClusterClientCertificatethumbprint { get; set; } + /// The cluster management endpoint. + string[] ServiceFabricClusterManagementEndpoint { get; set; } + /// Maximum number of retries while attempting resolve the partition. + int? ServiceFabricClusterMaxPartitionResolutionRetry { get; set; } + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + string[] ServiceFabricClusterServerCertificateThumbprint { get; set; } + /// Server X509 Certificate Names Collection + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + /// Backend Title. + string Title { get; set; } + /// Backend TLS Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties Tl { get; set; } + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + bool? TlValidateCertificateChain { get; set; } + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + bool? TlValidateCertificateName { get; set; } + /// Runtime Url of the Backend. + string Url { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContract.json.cs new file mode 100644 index 000000000000..639b53ba4696 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend details. + public partial class BackendContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContractProperties.cs new file mode 100644 index 000000000000..420f729d7a30 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContractProperties.cs @@ -0,0 +1,228 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create Backend operation. + public partial class BackendContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParameters __backendBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendBaseParameters(); + + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string AuthorizationParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationParameter = value ?? null; } + + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string AuthorizationScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationScheme = value ?? null; } + + /// Backend Circuit Breaker Configuration + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker CircuitBreaker { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CircuitBreaker; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CircuitBreaker = value ?? null /* model class */; } + + /// The rules for tripping the backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CircuitBreakerRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CircuitBreakerRule = value ?? null /* arrayOf */; } + + /// Backend Credentials Contract Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Credentials = value ?? null /* model class */; } + + /// Authorization header authentication + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials CredentialsAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsAuthorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsAuthorization = value ?? null /* model class */; } + + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] CredentialsCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificate = value ?? null /* arrayOf */; } + + /// List of Client Certificate Ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] CredentialsCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificateId = value ?? null /* arrayOf */; } + + /// Header Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsHeader = value ?? null /* model class */; } + + /// Query Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsQuery = value ?? null /* model class */; } + + /// Backend Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Description = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool Pool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Pool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Pool = value ?? null /* model class */; } + + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).PoolService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).PoolService = value ?? null /* arrayOf */; } + + /// Backend Properties contract + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Property = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol _protocol; + + /// Backend communication protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol Protocol { get => this._protocol; set => this._protocol = value; } + + /// Backend gateway Contract Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract Proxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Proxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Proxy = value ?? null /* model class */; } + + /// Password to connect to the WebProxy Server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProxyPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyPassword = value ?? null; } + + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProxyUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUrl = value ?? null; } + + /// Username to connect to the WebProxy server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProxyUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUsername = value ?? null; } + + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ResourceId = value ?? null; } + + /// Backend Service Fabric Cluster Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties ServiceFabricCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricCluster = value ?? null /* model class */; } + + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ServiceFabricClusterClientCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificateId = value ?? null; } + + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ServiceFabricClusterClientCertificatethumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificatethumbprint = value ?? null; } + + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] ServiceFabricClusterManagementEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterManagementEndpoint = value ?? null /* arrayOf */; } + + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public int? ServiceFabricClusterMaxPartitionResolutionRetry { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterMaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterMaxPartitionResolutionRetry = value ?? default(int); } + + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] ServiceFabricClusterServerCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerCertificateThumbprint = value ?? null /* arrayOf */; } + + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerX509Name = value ?? null /* arrayOf */; } + + /// Backend Title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Title = value ?? null; } + + /// Backend TLS Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties Tl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Tl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Tl = value ?? null /* model class */; } + + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? TlValidateCertificateChain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateChain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateChain = value ?? default(bool); } + + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? TlValidateCertificateName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateName = value ?? default(bool); } + + /// Type of the backend. A backend can be either Single or Pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType)""); } + + /// Backing field for property. + private string _url; + + /// Runtime Url of the Backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Url { get => this._url; set => this._url = value; } + + /// Creates an new instance. + public BackendContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__backendBaseParameters), __backendBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__backendBaseParameters), __backendBaseParameters); + } + } + /// Parameters supplied to the Create Backend operation. + public partial interface IBackendContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParameters + { + /// Backend communication protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Backend communication protocol.", + SerializedName = @"protocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol Protocol { get; set; } + /// Runtime Url of the Backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Runtime Url of the Backend.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + + } + /// Parameters supplied to the Create Backend operation. + internal partial interface IBackendContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal + { + /// Backend communication protocol. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol Protocol { get; set; } + /// Runtime Url of the Backend. + string Url { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContractProperties.json.cs new file mode 100644 index 000000000000..d0c884a0466c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendContractProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create Backend operation. + public partial class BackendContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __backendBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendBaseParameters(json); + {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)Url;} + {_protocol = If( json?.PropertyT("protocol"), out var __jsonProtocol) ? (string)__jsonProtocol : (string)Protocol;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __backendBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._url)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._url.ToString()) : null, "url" ,container.Add ); + AddIf( null != (((object)this._protocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._protocol.ToString()) : null, "protocol" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContract.cs new file mode 100644 index 000000000000..f6aad271b6c1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContract.cs @@ -0,0 +1,148 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Details of the Credentials used to connect to Backend. + public partial class BackendCredentialsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials _authorization; + + /// Authorization header authentication + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials Authorization { get => (this._authorization = this._authorization ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendAuthorizationHeaderCredentials()); set => this._authorization = value; } + + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string AuthorizationParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentialsInternal)Authorization).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentialsInternal)Authorization).Parameter = value ?? null; } + + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string AuthorizationScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentialsInternal)Authorization).Scheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentialsInternal)Authorization).Scheme = value ?? null; } + + /// Backing field for property. + private string[] _certificate; + + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Certificate { get => this._certificate; set => this._certificate = value; } + + /// Backing field for property. + private string[] _certificateId; + + /// List of Client Certificate Ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] CertificateId { get => this._certificateId; set => this._certificateId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader _header; + + /// Header Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader Header { get => (this._header = this._header ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCredentialsContractHeader()); set => this._header = value; } + + /// Internal Acessors for Authorization + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractInternal.Authorization { get => (this._authorization = this._authorization ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendAuthorizationHeaderCredentials()); set { {_authorization = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery _query; + + /// Query Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery Query { get => (this._query = this._query ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCredentialsContractQuery()); set => this._query = value; } + + /// Creates an new instance. + public BackendCredentialsContract() + { + + } + } + /// Details of the Credentials used to connect to Backend. + public partial interface IBackendCredentialsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication Parameter value.", + SerializedName = @"parameter", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationParameter { get; set; } + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication Scheme name.", + SerializedName = @"scheme", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationScheme { get; set; } + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided.", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + string[] Certificate { get; set; } + /// List of Client Certificate Ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Client Certificate Ids.", + SerializedName = @"certificateIds", + PossibleTypes = new [] { typeof(string) })] + string[] CertificateId { get; set; } + /// Header Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Header Parameter description.", + SerializedName = @"header", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader Header { get; set; } + /// Query Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query Parameter description.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery Query { get; set; } + + } + /// Details of the Credentials used to connect to Backend. + internal partial interface IBackendCredentialsContractInternal + + { + /// Authorization header authentication + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials Authorization { get; set; } + /// Authentication Parameter value. + string AuthorizationParameter { get; set; } + /// Authentication Scheme name. + string AuthorizationScheme { get; set; } + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + string[] Certificate { get; set; } + /// List of Client Certificate Ids. + string[] CertificateId { get; set; } + /// Header Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader Header { get; set; } + /// Query Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery Query { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContract.json.cs new file mode 100644 index 000000000000..82ede06f099f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContract.json.cs @@ -0,0 +1,132 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Details of the Credentials used to connect to Backend. + public partial class BackendCredentialsContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendCredentialsContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authorization = If( json?.PropertyT("authorization"), out var __jsonAuthorization) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendAuthorizationHeaderCredentials.FromJson(__jsonAuthorization) : Authorization;} + {_certificateId = If( json?.PropertyT("certificateIds"), out var __jsonCertificateIds) ? If( __jsonCertificateIds as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : CertificateId;} + {_certificate = If( json?.PropertyT("certificate"), out var __jsonCertificate) ? If( __jsonCertificate as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : Certificate;} + {_query = If( json?.PropertyT("query"), out var __jsonQuery) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCredentialsContractQuery.FromJson(__jsonQuery) : Query;} + {_header = If( json?.PropertyT("header"), out var __jsonHeader) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCredentialsContractHeader.FromJson(__jsonHeader) : Header;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendCredentialsContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._authorization ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._authorization.ToJson(null,serializationMode) : null, "authorization" ,container.Add ); + if (null != this._certificateId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._certificateId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("certificateIds",__w); + } + if (null != this._certificate) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._certificate ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("certificate",__r); + } + AddIf( null != this._query ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._query.ToJson(null,serializationMode) : null, "query" ,container.Add ); + AddIf( null != this._header ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._header.ToJson(null,serializationMode) : null, "header" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractHeader.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractHeader.cs new file mode 100644 index 000000000000..964675a4a965 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractHeader.cs @@ -0,0 +1,35 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Header Parameter description. + public partial class BackendCredentialsContractHeader : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeaderInternal + { + + /// Creates an new instance. + public BackendCredentialsContractHeader() + { + + } + } + /// Header Parameter description. + public partial interface IBackendCredentialsContractHeader : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// Header Parameter description. + internal partial interface IBackendCredentialsContractHeaderInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractHeader.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractHeader.dictionary.cs new file mode 100644 index 000000000000..3d77bb154312 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractHeader.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class BackendCredentialsContractHeader : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string[] this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string[] value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string[] value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCredentialsContractHeader source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractHeader.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractHeader.json.cs new file mode 100644 index 000000000000..ba611ed6f9a6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractHeader.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Header Parameter description. + public partial class BackendCredentialsContractHeader + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal BackendCredentialsContractHeader(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendCredentialsContractHeader(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractQuery.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractQuery.cs new file mode 100644 index 000000000000..a62441bb9d69 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractQuery.cs @@ -0,0 +1,35 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Query Parameter description. + public partial class BackendCredentialsContractQuery : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQueryInternal + { + + /// Creates an new instance. + public BackendCredentialsContractQuery() + { + + } + } + /// Query Parameter description. + public partial interface IBackendCredentialsContractQuery : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// Query Parameter description. + internal partial interface IBackendCredentialsContractQueryInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractQuery.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractQuery.dictionary.cs new file mode 100644 index 000000000000..4b3d45875344 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractQuery.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class BackendCredentialsContractQuery : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string[] this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string[] value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string[] value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendCredentialsContractQuery source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractQuery.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractQuery.json.cs new file mode 100644 index 000000000000..3aab51f0e54b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendCredentialsContractQuery.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Query Parameter description. + public partial class BackendCredentialsContractQuery + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal BackendCredentialsContractQuery(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendCredentialsContractQuery(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPool.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPool.cs new file mode 100644 index 000000000000..5b2cba77c741 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPool.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend pool information + public partial class BackendPool : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPool, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] _service; + + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] Service { get => this._service; set => this._service = value; } + + /// Creates an new instance. + public BackendPool() + { + + } + } + /// Backend pool information + public partial interface IBackendPool : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of backend entities belonging to a pool.", + SerializedName = @"services", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] Service { get; set; } + + } + /// Backend pool information + internal partial interface IBackendPoolInternal + + { + /// The list of backend entities belonging to a pool. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] Service { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPool.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPool.json.cs new file mode 100644 index 000000000000..eb3b94aa218f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPool.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend pool information + public partial class BackendPool + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendPool(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_service = If( json?.PropertyT("services"), out var __jsonServices) ? If( __jsonServices as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendPoolItem.FromJson(__u) )) ))() : null : Service;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPool. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPool. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPool FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendPool(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._service) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._service ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("services",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPoolItem.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPoolItem.cs new file mode 100644 index 000000000000..45d6e0352f9d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPoolItem.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend pool service information + public partial class BackendPoolItem : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItemInternal + { + + /// Backing field for property. + private string _id; + + /// + /// The unique ARM id of the backend entity. The ARM id should refer to an already existing backend entity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Creates an new instance. + public BackendPoolItem() + { + + } + } + /// Backend pool service information + public partial interface IBackendPoolItem : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The unique ARM id of the backend entity. The ARM id should refer to an already existing backend entity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The unique ARM id of the backend entity. The ARM id should refer to an already existing backend entity.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + } + /// Backend pool service information + internal partial interface IBackendPoolItemInternal + + { + /// + /// The unique ARM id of the backend entity. The ARM id should refer to an already existing backend entity. + /// + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPoolItem.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPoolItem.json.cs new file mode 100644 index 000000000000..ca199d87e8ad --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendPoolItem.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend pool service information + public partial class BackendPoolItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendPoolItem(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendPoolItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProperties.cs new file mode 100644 index 000000000000..cbe4399b734e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProperties.cs @@ -0,0 +1,142 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties specific to the Backend Type. + public partial class BackendProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal + { + + /// Internal Acessors for ServiceFabricCluster + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPropertiesInternal.ServiceFabricCluster { get => (this._serviceFabricCluster = this._serviceFabricCluster ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendServiceFabricClusterProperties()); set { {_serviceFabricCluster = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties _serviceFabricCluster; + + /// Backend Service Fabric Cluster Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties ServiceFabricCluster { get => (this._serviceFabricCluster = this._serviceFabricCluster ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendServiceFabricClusterProperties()); set => this._serviceFabricCluster = value; } + + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceFabricClusterClientCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ClientCertificateId = value ?? null; } + + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceFabricClusterClientCertificatethumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ClientCertificatethumbprint = value ?? null; } + + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] ServiceFabricClusterManagementEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ManagementEndpoint = value ?? null /* arrayOf */; } + + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? ServiceFabricClusterMaxPartitionResolutionRetry { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).MaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).MaxPartitionResolutionRetry = value ?? default(int); } + + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] ServiceFabricClusterServerCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ServerCertificateThumbprint = value ?? null /* arrayOf */; } + + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal)ServiceFabricCluster).ServerX509Name = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public BackendProperties() + { + + } + } + /// Properties specific to the Backend Type. + public partial interface IBackendProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client certificate id for the management endpoint.", + SerializedName = @"clientCertificateId", + PossibleTypes = new [] { typeof(string) })] + string ServiceFabricClusterClientCertificateId { get; set; } + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided", + SerializedName = @"clientCertificatethumbprint", + PossibleTypes = new [] { typeof(string) })] + string ServiceFabricClusterClientCertificatethumbprint { get; set; } + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster management endpoint.", + SerializedName = @"managementEndpoints", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceFabricClusterManagementEndpoint { get; set; } + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of retries while attempting resolve the partition.", + SerializedName = @"maxPartitionResolutionRetries", + PossibleTypes = new [] { typeof(int) })] + int? ServiceFabricClusterMaxPartitionResolutionRetry { get; set; } + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprints of certificates cluster management service uses for tls communication", + SerializedName = @"serverCertificateThumbprints", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceFabricClusterServerCertificateThumbprint { get; set; } + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server X509 Certificate Names Collection", + SerializedName = @"serverX509Names", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + + } + /// Properties specific to the Backend Type. + internal partial interface IBackendPropertiesInternal + + { + /// Backend Service Fabric Cluster Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties ServiceFabricCluster { get; set; } + /// The client certificate id for the management endpoint. + string ServiceFabricClusterClientCertificateId { get; set; } + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + string ServiceFabricClusterClientCertificatethumbprint { get; set; } + /// The cluster management endpoint. + string[] ServiceFabricClusterManagementEndpoint { get; set; } + /// Maximum number of retries while attempting resolve the partition. + int? ServiceFabricClusterMaxPartitionResolutionRetry { get; set; } + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + string[] ServiceFabricClusterServerCertificateThumbprint { get; set; } + /// Server X509 Certificate Names Collection + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProperties.json.cs new file mode 100644 index 000000000000..96fe392748ef --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties specific to the Backend Type. + public partial class BackendProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serviceFabricCluster = If( json?.PropertyT("serviceFabricCluster"), out var __jsonServiceFabricCluster) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendServiceFabricClusterProperties.FromJson(__jsonServiceFabricCluster) : ServiceFabricCluster;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._serviceFabricCluster ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._serviceFabricCluster.ToJson(null,serializationMode) : null, "serviceFabricCluster" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProxyContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProxyContract.cs new file mode 100644 index 000000000000..007c05dd6371 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProxyContract.cs @@ -0,0 +1,94 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Details of the Backend WebProxy Server to use in the Request to Backend. + public partial class BackendProxyContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContractInternal + { + + /// Backing field for property. + private string _password; + + /// Password to connect to the WebProxy Server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Password { get => this._password; set => this._password = value; } + + /// Backing field for property. + private string _url; + + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Url { get => this._url; set => this._url = value; } + + /// Backing field for property. + private string _username; + + /// Username to connect to the WebProxy server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Username { get => this._username; set => this._username = value; } + + /// Creates an new instance. + public BackendProxyContract() + { + + } + } + /// Details of the Backend WebProxy Server to use in the Request to Backend. + public partial interface IBackendProxyContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Password to connect to the WebProxy Server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to the WebProxy Server", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string Password { get; set; } + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + /// Username to connect to the WebProxy server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to connect to the WebProxy server", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string Username { get; set; } + + } + /// Details of the Backend WebProxy Server to use in the Request to Backend. + internal partial interface IBackendProxyContractInternal + + { + /// Password to connect to the WebProxy Server + string Password { get; set; } + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + string Url { get; set; } + /// Username to connect to the WebProxy server + string Username { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProxyContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProxyContract.json.cs new file mode 100644 index 000000000000..83becd10a87c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendProxyContract.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Details of the Backend WebProxy Server to use in the Request to Backend. + public partial class BackendProxyContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendProxyContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)Url;} + {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)Username;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendProxyContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._url)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._url.ToString()) : null, "url" ,container.Add ); + AddIf( null != (((object)this._username)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._username.ToString()) : null, "username" ,container.Add ); + AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._password.ToString()) : null, "password" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectContract.cs new file mode 100644 index 000000000000..f95421ed57ee --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectContract.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Reconnect request parameters. + public partial class BackendReconnectContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.TimeSpan? After { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectPropertiesInternal)Property).After; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectPropertiesInternal)Property).After = value ?? default(global::System.TimeSpan); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendReconnectProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectProperties _property; + + /// Reconnect request properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendReconnectProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public BackendReconnectContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Reconnect request parameters. + public partial interface IBackendReconnectContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M.", + SerializedName = @"after", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? After { get; set; } + + } + /// Reconnect request parameters. + internal partial interface IBackendReconnectContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. + /// + global::System.TimeSpan? After { get; set; } + /// Reconnect request properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectContract.json.cs new file mode 100644 index 000000000000..3e0fb631dea5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Reconnect request parameters. + public partial class BackendReconnectContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendReconnectContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendReconnectProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendReconnectContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectProperties.cs new file mode 100644 index 000000000000..83916cdc2358 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectProperties.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties to control reconnect requests. + public partial class BackendReconnectProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectPropertiesInternal + { + + /// Backing field for property. + private global::System.TimeSpan? _after; + + /// + /// Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.TimeSpan? After { get => this._after; set => this._after = value; } + + /// Creates an new instance. + public BackendReconnectProperties() + { + + } + } + /// Properties to control reconnect requests. + public partial interface IBackendReconnectProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M.", + SerializedName = @"after", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? After { get; set; } + + } + /// Properties to control reconnect requests. + internal partial interface IBackendReconnectPropertiesInternal + + { + /// + /// Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. + /// + global::System.TimeSpan? After { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectProperties.json.cs new file mode 100644 index 000000000000..556777c6cc8e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendReconnectProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties to control reconnect requests. + public partial class BackendReconnectProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendReconnectProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_after = If( json?.PropertyT("after"), out var __jsonAfter) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonAfter ) : After;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendReconnectProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendReconnectProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)(null != this._after ? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._after)): null), "after" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendServiceFabricClusterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendServiceFabricClusterProperties.cs new file mode 100644 index 000000000000..549738b63afc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendServiceFabricClusterProperties.cs @@ -0,0 +1,148 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Service Fabric Type Backend. + public partial class BackendServiceFabricClusterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterPropertiesInternal + { + + /// Backing field for property. + private string _clientCertificateId; + + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientCertificateId { get => this._clientCertificateId; set => this._clientCertificateId = value; } + + /// Backing field for property. + private string _clientCertificatethumbprint; + + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientCertificatethumbprint { get => this._clientCertificatethumbprint; set => this._clientCertificatethumbprint = value; } + + /// Backing field for property. + private string[] _managementEndpoint; + + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] ManagementEndpoint { get => this._managementEndpoint; set => this._managementEndpoint = value; } + + /// Backing field for property. + private int? _maxPartitionResolutionRetry; + + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? MaxPartitionResolutionRetry { get => this._maxPartitionResolutionRetry; set => this._maxPartitionResolutionRetry = value; } + + /// Backing field for property. + private string[] _serverCertificateThumbprint; + + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] ServerCertificateThumbprint { get => this._serverCertificateThumbprint; set => this._serverCertificateThumbprint = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] _serverX509Name; + + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServerX509Name { get => this._serverX509Name; set => this._serverX509Name = value; } + + /// Creates an new instance. + public BackendServiceFabricClusterProperties() + { + + } + } + /// Properties of the Service Fabric Type Backend. + public partial interface IBackendServiceFabricClusterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client certificate id for the management endpoint.", + SerializedName = @"clientCertificateId", + PossibleTypes = new [] { typeof(string) })] + string ClientCertificateId { get; set; } + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided", + SerializedName = @"clientCertificatethumbprint", + PossibleTypes = new [] { typeof(string) })] + string ClientCertificatethumbprint { get; set; } + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The cluster management endpoint.", + SerializedName = @"managementEndpoints", + PossibleTypes = new [] { typeof(string) })] + string[] ManagementEndpoint { get; set; } + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of retries while attempting resolve the partition.", + SerializedName = @"maxPartitionResolutionRetries", + PossibleTypes = new [] { typeof(int) })] + int? MaxPartitionResolutionRetry { get; set; } + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprints of certificates cluster management service uses for tls communication", + SerializedName = @"serverCertificateThumbprints", + PossibleTypes = new [] { typeof(string) })] + string[] ServerCertificateThumbprint { get; set; } + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server X509 Certificate Names Collection", + SerializedName = @"serverX509Names", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServerX509Name { get; set; } + + } + /// Properties of the Service Fabric Type Backend. + internal partial interface IBackendServiceFabricClusterPropertiesInternal + + { + /// The client certificate id for the management endpoint. + string ClientCertificateId { get; set; } + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + string ClientCertificatethumbprint { get; set; } + /// The cluster management endpoint. + string[] ManagementEndpoint { get; set; } + /// Maximum number of retries while attempting resolve the partition. + int? MaxPartitionResolutionRetry { get; set; } + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + string[] ServerCertificateThumbprint { get; set; } + /// Server X509 Certificate Names Collection + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServerX509Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendServiceFabricClusterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendServiceFabricClusterProperties.json.cs new file mode 100644 index 000000000000..eec01fffeabc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendServiceFabricClusterProperties.json.cs @@ -0,0 +1,143 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Service Fabric Type Backend. + public partial class BackendServiceFabricClusterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendServiceFabricClusterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clientCertificateId = If( json?.PropertyT("clientCertificateId"), out var __jsonClientCertificateId) ? (string)__jsonClientCertificateId : (string)ClientCertificateId;} + {_clientCertificatethumbprint = If( json?.PropertyT("clientCertificatethumbprint"), out var __jsonClientCertificatethumbprint) ? (string)__jsonClientCertificatethumbprint : (string)ClientCertificatethumbprint;} + {_maxPartitionResolutionRetry = If( json?.PropertyT("maxPartitionResolutionRetries"), out var __jsonMaxPartitionResolutionRetries) ? (int?)__jsonMaxPartitionResolutionRetries : MaxPartitionResolutionRetry;} + {_managementEndpoint = If( json?.PropertyT("managementEndpoints"), out var __jsonManagementEndpoints) ? If( __jsonManagementEndpoints as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ManagementEndpoint;} + {_serverCertificateThumbprint = If( json?.PropertyT("serverCertificateThumbprints"), out var __jsonServerCertificateThumbprints) ? If( __jsonServerCertificateThumbprints as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ServerCertificateThumbprint;} + {_serverX509Name = If( json?.PropertyT("serverX509Names"), out var __jsonServerX509Names) ? If( __jsonServerX509Names as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.X509CertificateName.FromJson(__k) )) ))() : null : ServerX509Name;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendServiceFabricClusterProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._clientCertificateId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientCertificateId.ToString()) : null, "clientCertificateId" ,container.Add ); + AddIf( null != (((object)this._clientCertificatethumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientCertificatethumbprint.ToString()) : null, "clientCertificatethumbprint" ,container.Add ); + AddIf( null != this._maxPartitionResolutionRetry ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._maxPartitionResolutionRetry) : null, "maxPartitionResolutionRetries" ,container.Add ); + if (null != this._managementEndpoint) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._managementEndpoint ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("managementEndpoints",__w); + } + if (null != this._serverCertificateThumbprint) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._serverCertificateThumbprint ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("serverCertificateThumbprints",__r); + } + if (null != this._serverX509Name) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __n in this._serverX509Name ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("serverX509Names",__m); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendTlsProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendTlsProperties.cs new file mode 100644 index 000000000000..8fff51ee7dea --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendTlsProperties.cs @@ -0,0 +1,86 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties controlling TLS Certificate Validation. + public partial class BackendTlsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsPropertiesInternal + { + + /// Backing field for property. + private bool? _validateCertificateChain; + + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? ValidateCertificateChain { get => this._validateCertificateChain; set => this._validateCertificateChain = value; } + + /// Backing field for property. + private bool? _validateCertificateName; + + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? ValidateCertificateName { get => this._validateCertificateName; set => this._validateCertificateName = value; } + + /// Creates an new instance. + public BackendTlsProperties() + { + + } + } + /// Properties controlling TLS Certificate Validation. + public partial interface IBackendTlsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host.", + SerializedName = @"validateCertificateChain", + PossibleTypes = new [] { typeof(bool) })] + bool? ValidateCertificateChain { get; set; } + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host.", + SerializedName = @"validateCertificateName", + PossibleTypes = new [] { typeof(bool) })] + bool? ValidateCertificateName { get; set; } + + } + /// Properties controlling TLS Certificate Validation. + internal partial interface IBackendTlsPropertiesInternal + + { + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + bool? ValidateCertificateChain { get; set; } + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + bool? ValidateCertificateName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendTlsProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendTlsProperties.json.cs new file mode 100644 index 000000000000..b3f335d27f59 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendTlsProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties controlling TLS Certificate Validation. + public partial class BackendTlsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendTlsProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_validateCertificateChain = If( json?.PropertyT("validateCertificateChain"), out var __jsonValidateCertificateChain) ? (bool?)__jsonValidateCertificateChain : ValidateCertificateChain;} + {_validateCertificateName = If( json?.PropertyT("validateCertificateName"), out var __jsonValidateCertificateName) ? (bool?)__jsonValidateCertificateName : ValidateCertificateName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendTlsProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._validateCertificateChain ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._validateCertificateChain) : null, "validateCertificateChain" ,container.Add ); + AddIf( null != this._validateCertificateName ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._validateCertificateName) : null, "validateCertificateName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameterProperties.cs new file mode 100644 index 000000000000..48fe233be0f2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameterProperties.cs @@ -0,0 +1,228 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Backend operation. + public partial class BackendUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParameters __backendBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendBaseParameters(); + + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string AuthorizationParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationParameter = value ?? null; } + + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string AuthorizationScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).AuthorizationScheme = value ?? null; } + + /// Backend Circuit Breaker Configuration + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker CircuitBreaker { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CircuitBreaker; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CircuitBreaker = value ?? null /* model class */; } + + /// The rules for tripping the backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CircuitBreakerRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CircuitBreakerRule = value ?? null /* arrayOf */; } + + /// Backend Credentials Contract Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Credentials = value ?? null /* model class */; } + + /// Authorization header authentication + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials CredentialsAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsAuthorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsAuthorization = value ?? null /* model class */; } + + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] CredentialsCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificate = value ?? null /* arrayOf */; } + + /// List of Client Certificate Ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] CredentialsCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsCertificateId = value ?? null /* arrayOf */; } + + /// Header Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsHeader = value ?? null /* model class */; } + + /// Query Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).CredentialsQuery = value ?? null /* model class */; } + + /// Backend Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Description = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool Pool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Pool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Pool = value ?? null /* model class */; } + + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).PoolService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).PoolService = value ?? null /* arrayOf */; } + + /// Backend Properties contract + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties Property { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Property = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol? _protocol; + + /// Backend communication protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol? Protocol { get => this._protocol; set => this._protocol = value; } + + /// Backend gateway Contract Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract Proxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Proxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Proxy = value ?? null /* model class */; } + + /// Password to connect to the WebProxy Server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProxyPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyPassword = value ?? null; } + + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProxyUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUrl = value ?? null; } + + /// Username to connect to the WebProxy server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProxyUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ProxyUsername = value ?? null; } + + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ResourceId = value ?? null; } + + /// Backend Service Fabric Cluster Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties ServiceFabricCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricCluster = value ?? null /* model class */; } + + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ServiceFabricClusterClientCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificateId = value ?? null; } + + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ServiceFabricClusterClientCertificatethumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterClientCertificatethumbprint = value ?? null; } + + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] ServiceFabricClusterManagementEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterManagementEndpoint = value ?? null /* arrayOf */; } + + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public int? ServiceFabricClusterMaxPartitionResolutionRetry { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterMaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterMaxPartitionResolutionRetry = value ?? default(int); } + + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] ServiceFabricClusterServerCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerCertificateThumbprint = value ?? null /* arrayOf */; } + + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).ServiceFabricClusterServerX509Name = value ?? null /* arrayOf */; } + + /// Backend Title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Title = value ?? null; } + + /// Backend TLS Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties Tl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Tl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Tl = value ?? null /* model class */; } + + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? TlValidateCertificateChain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateChain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateChain = value ?? default(bool); } + + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? TlValidateCertificateName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).TlValidateCertificateName = value ?? default(bool); } + + /// Type of the backend. A backend can be either Single or Pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)__backendBaseParameters).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType)""); } + + /// Backing field for property. + private string _url; + + /// Runtime Url of the Backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Url { get => this._url; set => this._url = value; } + + /// Creates an new instance. + public BackendUpdateParameterProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__backendBaseParameters), __backendBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__backendBaseParameters), __backendBaseParameters); + } + } + /// Parameters supplied to the Update Backend operation. + public partial interface IBackendUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParameters + { + /// Backend communication protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backend communication protocol.", + SerializedName = @"protocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol? Protocol { get; set; } + /// Runtime Url of the Backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Runtime Url of the Backend.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + + } + /// Parameters supplied to the Update Backend operation. + internal partial interface IBackendUpdateParameterPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal + { + /// Backend communication protocol. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol? Protocol { get; set; } + /// Runtime Url of the Backend. + string Url { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..180a42dbe820 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameterProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Backend operation. + public partial class BackendUpdateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendUpdateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __backendBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendBaseParameters(json); + {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)Url;} + {_protocol = If( json?.PropertyT("protocol"), out var __jsonProtocol) ? (string)__jsonProtocol : (string)Protocol;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendUpdateParameterProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __backendBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._url)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._url.ToString()) : null, "url" ,container.Add ); + AddIf( null != (((object)this._protocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._protocol.ToString()) : null, "protocol" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameters.cs new file mode 100644 index 000000000000..266f0e117a4e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameters.cs @@ -0,0 +1,490 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend update parameters. + public partial class BackendUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParametersInternal + { + + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string AuthorizationParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).AuthorizationParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).AuthorizationParameter = value ?? null; } + + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string AuthorizationScheme { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).AuthorizationScheme; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).AuthorizationScheme = value ?? null; } + + /// The rules for tripping the backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CircuitBreakerRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CircuitBreakerRule = value ?? null /* arrayOf */; } + + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CredentialsCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsCertificate = value ?? null /* arrayOf */; } + + /// List of Client Certificate Ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CredentialsCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsCertificateId = value ?? null /* arrayOf */; } + + /// Header Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsHeader = value ?? null /* model class */; } + + /// Query Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsQuery = value ?? null /* model class */; } + + /// Backend Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Description = value ?? null; } + + /// Internal Acessors for BackendProperty + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParametersInternal.BackendProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Property = value; } + + /// Internal Acessors for CircuitBreaker + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParametersInternal.CircuitBreaker { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CircuitBreaker; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CircuitBreaker = value; } + + /// Internal Acessors for Credentials + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParametersInternal.Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Credentials = value; } + + /// Internal Acessors for CredentialsAuthorization + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParametersInternal.CredentialsAuthorization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsAuthorization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).CredentialsAuthorization = value; } + + /// Internal Acessors for Pool + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParametersInternal.Pool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Pool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Pool = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendUpdateParameterProperties()); set { {_property = value;} } } + + /// Internal Acessors for Proxy + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParametersInternal.Proxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Proxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Proxy = value; } + + /// Internal Acessors for ServiceFabricCluster + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParametersInternal.ServiceFabricCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricCluster = value; } + + /// Internal Acessors for Tl + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParametersInternal.Tl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Tl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Tl = value; } + + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).PoolService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).PoolService = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterProperties _property; + + /// Backend entity update contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendUpdateParameterProperties()); set => this._property = value; } + + /// Backend communication protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol? Protocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterPropertiesInternal)Property).Protocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterPropertiesInternal)Property).Protocol = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol)""); } + + /// Password to connect to the WebProxy Server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProxyPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyPassword = value ?? null; } + + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProxyUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyUrl = value ?? null; } + + /// Username to connect to the WebProxy server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProxyUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ProxyUsername = value ?? null; } + + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ResourceId = value ?? null; } + + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceFabricClusterClientCertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificateId = value ?? null; } + + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceFabricClusterClientCertificatethumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificatethumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterClientCertificatethumbprint = value ?? null; } + + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] ServiceFabricClusterManagementEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterManagementEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterManagementEndpoint = value ?? null /* arrayOf */; } + + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? ServiceFabricClusterMaxPartitionResolutionRetry { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterMaxPartitionResolutionRetry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterMaxPartitionResolutionRetry = value ?? default(int); } + + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] ServiceFabricClusterServerCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerCertificateThumbprint = value ?? null /* arrayOf */; } + + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerX509Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).ServiceFabricClusterServerX509Name = value ?? null /* arrayOf */; } + + /// Backend Title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Title = value ?? null; } + + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TlValidateCertificateChain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).TlValidateCertificateChain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).TlValidateCertificateChain = value ?? default(bool); } + + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TlValidateCertificateName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).TlValidateCertificateName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).TlValidateCertificateName = value ?? default(bool); } + + /// Type of the backend. A backend can be either Single or Pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType)""); } + + /// Runtime Url of the Backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Url { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterPropertiesInternal)Property).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterPropertiesInternal)Property).Url = value ?? null; } + + /// Creates an new instance. + public BackendUpdateParameters() + { + + } + } + /// Backend update parameters. + public partial interface IBackendUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Authentication Parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication Parameter value.", + SerializedName = @"parameter", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationParameter { get; set; } + /// Authentication Scheme name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authentication Scheme name.", + SerializedName = @"scheme", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationScheme { get; set; } + /// The rules for tripping the backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The rules for tripping the backend.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get; set; } + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided.", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + string[] CredentialsCertificate { get; set; } + /// List of Client Certificate Ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Client Certificate Ids.", + SerializedName = @"certificateIds", + PossibleTypes = new [] { typeof(string) })] + string[] CredentialsCertificateId { get; set; } + /// Header Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Header Parameter description.", + SerializedName = @"header", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get; set; } + /// Query Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query Parameter description.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get; set; } + /// Backend Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backend Description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The list of backend entities belonging to a pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of backend entities belonging to a pool.", + SerializedName = @"services", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get; set; } + /// Backend communication protocol. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backend communication protocol.", + SerializedName = @"protocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol? Protocol { get; set; } + /// Password to connect to the WebProxy Server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password to connect to the WebProxy Server", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string ProxyPassword { get; set; } + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string ProxyUrl { get; set; } + /// Username to connect to the WebProxy server + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username to connect to the WebProxy server", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string ProxyUsername { get; set; } + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or API Apps.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// The client certificate id for the management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client certificate id for the management endpoint.", + SerializedName = @"clientCertificateId", + PossibleTypes = new [] { typeof(string) })] + string ServiceFabricClusterClientCertificateId { get; set; } + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided", + SerializedName = @"clientCertificatethumbprint", + PossibleTypes = new [] { typeof(string) })] + string ServiceFabricClusterClientCertificatethumbprint { get; set; } + /// The cluster management endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster management endpoint.", + SerializedName = @"managementEndpoints", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceFabricClusterManagementEndpoint { get; set; } + /// Maximum number of retries while attempting resolve the partition. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum number of retries while attempting resolve the partition.", + SerializedName = @"maxPartitionResolutionRetries", + PossibleTypes = new [] { typeof(int) })] + int? ServiceFabricClusterMaxPartitionResolutionRetry { get; set; } + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprints of certificates cluster management service uses for tls communication", + SerializedName = @"serverCertificateThumbprints", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceFabricClusterServerCertificateThumbprint { get; set; } + /// Server X509 Certificate Names Collection + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Server X509 Certificate Names Collection", + SerializedName = @"serverX509Names", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + /// Backend Title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Backend Title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host.", + SerializedName = @"validateCertificateChain", + PossibleTypes = new [] { typeof(bool) })] + bool? TlValidateCertificateChain { get; set; } + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host.", + SerializedName = @"validateCertificateName", + PossibleTypes = new [] { typeof(bool) })] + bool? TlValidateCertificateName { get; set; } + /// Type of the backend. A backend can be either Single or Pool. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the backend. A backend can be either Single or Pool.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? Type { get; set; } + /// Runtime Url of the Backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Runtime Url of the Backend.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + + } + /// Backend update parameters. + internal partial interface IBackendUpdateParametersInternal + + { + /// Authentication Parameter value. + string AuthorizationParameter { get; set; } + /// Authentication Scheme name. + string AuthorizationScheme { get; set; } + /// Backend Properties contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProperties BackendProperty { get; set; } + /// Backend Circuit Breaker Configuration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCircuitBreaker CircuitBreaker { get; set; } + /// The rules for tripping the backend. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule[] CircuitBreakerRule { get; set; } + /// Backend Credentials Contract Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContract Credentials { get; set; } + /// Authorization header authentication + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendAuthorizationHeaderCredentials CredentialsAuthorization { get; set; } + /// + /// List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. + /// + string[] CredentialsCertificate { get; set; } + /// List of Client Certificate Ids. + string[] CredentialsCertificateId { get; set; } + /// Header Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractHeader CredentialsHeader { get; set; } + /// Query Parameter description. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendCredentialsContractQuery CredentialsQuery { get; set; } + /// Backend Description. + string Description { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendBaseParametersPool Pool { get; set; } + /// The list of backend entities belonging to a pool. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendPoolItem[] PoolService { get; set; } + /// Backend entity update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameterProperties Property { get; set; } + /// Backend communication protocol. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol? Protocol { get; set; } + /// Backend gateway Contract Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendProxyContract Proxy { get; set; } + /// Password to connect to the WebProxy Server + string ProxyPassword { get; set; } + /// + /// WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments + /// and query strings. + /// + string ProxyUrl { get; set; } + /// Username to connect to the WebProxy server + string ProxyUsername { get; set; } + /// + /// Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or + /// API Apps. + /// + string ResourceId { get; set; } + /// Backend Service Fabric Cluster Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendServiceFabricClusterProperties ServiceFabricCluster { get; set; } + /// The client certificate id for the management endpoint. + string ServiceFabricClusterClientCertificateId { get; set; } + /// + /// The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided + /// + string ServiceFabricClusterClientCertificatethumbprint { get; set; } + /// The cluster management endpoint. + string[] ServiceFabricClusterManagementEndpoint { get; set; } + /// Maximum number of retries while attempting resolve the partition. + int? ServiceFabricClusterMaxPartitionResolutionRetry { get; set; } + /// + /// Thumbprints of certificates cluster management service uses for tls communication + /// + string[] ServiceFabricClusterServerCertificateThumbprint { get; set; } + /// Server X509 Certificate Names Collection + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName[] ServiceFabricClusterServerX509Name { get; set; } + /// Backend Title. + string Title { get; set; } + /// Backend TLS Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendTlsProperties Tl { get; set; } + /// + /// Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend + /// host. + /// + bool? TlValidateCertificateChain { get; set; } + /// + /// Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend + /// host. + /// + bool? TlValidateCertificateName { get; set; } + /// Type of the backend. A backend can be either Single or Pool. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType? Type { get; set; } + /// Runtime Url of the Backend. + string Url { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameters.json.cs new file mode 100644 index 000000000000..8f0f9c17de57 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BackendUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Backend update parameters. + public partial class BackendUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BackendUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBackendUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BodyDiagnosticSettings.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BodyDiagnosticSettings.cs new file mode 100644 index 000000000000..0240ccc04329 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BodyDiagnosticSettings.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Body logging settings. + public partial class BodyDiagnosticSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettingsInternal + { + + /// Backing field for property. + private int? _byte; + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? Byte { get => this._byte; set => this._byte = value; } + + /// Creates an new instance. + public BodyDiagnosticSettings() + { + + } + } + /// Body logging settings. + public partial interface IBodyDiagnosticSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? Byte { get; set; } + + } + /// Body logging settings. + internal partial interface IBodyDiagnosticSettingsInternal + + { + /// Number of request body bytes to log. + int? Byte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BodyDiagnosticSettings.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BodyDiagnosticSettings.json.cs new file mode 100644 index 000000000000..b8d83a9e89eb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/BodyDiagnosticSettings.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Body logging settings. + public partial class BodyDiagnosticSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BodyDiagnosticSettings(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_byte = If( json?.PropertyT("bytes"), out var __jsonBytes) ? (int?)__jsonBytes : Byte;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BodyDiagnosticSettings(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._byte ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._byte) : null, "bytes" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheCollection.cs new file mode 100644 index 000000000000..693067e76d94 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Caches list representation. + public partial class CacheCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public CacheCollection() + { + + } + } + /// Paged Caches list representation. + public partial interface ICacheCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract[] Value { get; set; } + + } + /// Paged Caches list representation. + internal partial interface ICacheCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheCollection.json.cs new file mode 100644 index 000000000000..2e66c8c377be --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Caches list representation. + public partial class CacheCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CacheCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CacheCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContract.cs new file mode 100644 index 000000000000..3c4cc80757fd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContract.cs @@ -0,0 +1,177 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Cache details. + public partial class CacheContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Runtime connection string to cache + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractPropertiesInternal)Property).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractPropertiesInternal)Property).ConnectionString = value ?? null; } + + /// Cache description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractPropertiesInternal)Property).Description = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractProperties _property; + + /// Cache properties details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheContractProperties()); set => this._property = value; } + + /// Original uri of entity in external system cache points to + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractPropertiesInternal)Property).ResourceId = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string UseFromLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractPropertiesInternal)Property).UseFromLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractPropertiesInternal)Property).UseFromLocation = value ?? null; } + + /// Creates an new instance. + public CacheContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Cache details. + public partial interface ICacheContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Runtime connection string to cache + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Runtime connection string to cache", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + string ConnectionString { get; set; } + /// Cache description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Cache description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Original uri of entity in external system cache points to + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Original uri of entity in external system cache points to", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location identifier to use cache from (should be either 'default' or valid Azure region identifier)", + SerializedName = @"useFromLocation", + PossibleTypes = new [] { typeof(string) })] + string UseFromLocation { get; set; } + + } + /// Cache details. + internal partial interface ICacheContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Runtime connection string to cache + string ConnectionString { get; set; } + /// Cache description + string Description { get; set; } + + string ETag { get; set; } + /// Cache properties details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractProperties Property { get; set; } + /// Original uri of entity in external system cache points to + string ResourceId { get; set; } + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + string UseFromLocation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContract.json.cs new file mode 100644 index 000000000000..3955d00b4507 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Cache details. + public partial class CacheContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CacheContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CacheContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContractProperties.cs new file mode 100644 index 000000000000..0e9e923e8156 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContractProperties.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Cache contract. + public partial class CacheContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractPropertiesInternal + { + + /// Backing field for property. + private string _connectionString; + + /// Runtime connection string to cache + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ConnectionString { get => this._connectionString; set => this._connectionString = value; } + + /// Backing field for property. + private string _description; + + /// Cache description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _resourceId; + + /// Original uri of entity in external system cache points to + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private string _useFromLocation; + + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UseFromLocation { get => this._useFromLocation; set => this._useFromLocation = value; } + + /// Creates an new instance. + public CacheContractProperties() + { + + } + } + /// Properties of the Cache contract. + public partial interface ICacheContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Runtime connection string to cache + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Runtime connection string to cache", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + string ConnectionString { get; set; } + /// Cache description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Cache description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Original uri of entity in external system cache points to + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Original uri of entity in external system cache points to", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Location identifier to use cache from (should be either 'default' or valid Azure region identifier)", + SerializedName = @"useFromLocation", + PossibleTypes = new [] { typeof(string) })] + string UseFromLocation { get; set; } + + } + /// Properties of the Cache contract. + internal partial interface ICacheContractPropertiesInternal + + { + /// Runtime connection string to cache + string ConnectionString { get; set; } + /// Cache description + string Description { get; set; } + /// Original uri of entity in external system cache points to + string ResourceId { get; set; } + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + string UseFromLocation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContractProperties.json.cs new file mode 100644 index 000000000000..f5215e65f5f2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheContractProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Cache contract. + public partial class CacheContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CacheContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_connectionString = If( json?.PropertyT("connectionString"), out var __jsonConnectionString) ? (string)__jsonConnectionString : (string)ConnectionString;} + {_useFromLocation = If( json?.PropertyT("useFromLocation"), out var __jsonUseFromLocation) ? (string)__jsonUseFromLocation : (string)UseFromLocation;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CacheContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._connectionString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._connectionString.ToString()) : null, "connectionString" ,container.Add ); + AddIf( null != (((object)this._useFromLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._useFromLocation.ToString()) : null, "useFromLocation" ,container.Add ); + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateParameters.cs new file mode 100644 index 000000000000..de86c0807b10 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateParameters.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Cache update details. + public partial class CacheUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateParametersInternal + { + + /// Runtime connection string to cache + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdatePropertiesInternal)Property).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdatePropertiesInternal)Property).ConnectionString = value ?? null; } + + /// Cache description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdatePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdatePropertiesInternal)Property).Description = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheUpdateProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateProperties _property; + + /// Cache update properties details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheUpdateProperties()); set => this._property = value; } + + /// Original uri of entity in external system cache points to + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdatePropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdatePropertiesInternal)Property).ResourceId = value ?? null; } + + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string UseFromLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdatePropertiesInternal)Property).UseFromLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdatePropertiesInternal)Property).UseFromLocation = value ?? null; } + + /// Creates an new instance. + public CacheUpdateParameters() + { + + } + } + /// Cache update details. + public partial interface ICacheUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Runtime connection string to cache + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Runtime connection string to cache", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + string ConnectionString { get; set; } + /// Cache description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Cache description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Original uri of entity in external system cache points to + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Original uri of entity in external system cache points to", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location identifier to use cache from (should be either 'default' or valid Azure region identifier)", + SerializedName = @"useFromLocation", + PossibleTypes = new [] { typeof(string) })] + string UseFromLocation { get; set; } + + } + /// Cache update details. + internal partial interface ICacheUpdateParametersInternal + + { + /// Runtime connection string to cache + string ConnectionString { get; set; } + /// Cache description + string Description { get; set; } + /// Cache update properties details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateProperties Property { get; set; } + /// Original uri of entity in external system cache points to + string ResourceId { get; set; } + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + string UseFromLocation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateParameters.json.cs new file mode 100644 index 000000000000..8fbcd169eac5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Cache update details. + public partial class CacheUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CacheUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CacheUpdateProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CacheUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateProperties.cs new file mode 100644 index 000000000000..280eeb44b090 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateProperties.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Cache operation. + public partial class CacheUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdatePropertiesInternal + { + + /// Backing field for property. + private string _connectionString; + + /// Runtime connection string to cache + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ConnectionString { get => this._connectionString; set => this._connectionString = value; } + + /// Backing field for property. + private string _description; + + /// Cache description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _resourceId; + + /// Original uri of entity in external system cache points to + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private string _useFromLocation; + + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UseFromLocation { get => this._useFromLocation; set => this._useFromLocation = value; } + + /// Creates an new instance. + public CacheUpdateProperties() + { + + } + } + /// Parameters supplied to the Update Cache operation. + public partial interface ICacheUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Runtime connection string to cache + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Runtime connection string to cache", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + string ConnectionString { get; set; } + /// Cache description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Cache description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Original uri of entity in external system cache points to + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Original uri of entity in external system cache points to", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location identifier to use cache from (should be either 'default' or valid Azure region identifier)", + SerializedName = @"useFromLocation", + PossibleTypes = new [] { typeof(string) })] + string UseFromLocation { get; set; } + + } + /// Parameters supplied to the Update Cache operation. + internal partial interface ICacheUpdatePropertiesInternal + + { + /// Runtime connection string to cache + string ConnectionString { get; set; } + /// Cache description + string Description { get; set; } + /// Original uri of entity in external system cache points to + string ResourceId { get; set; } + /// + /// Location identifier to use cache from (should be either 'default' or valid Azure region identifier) + /// + string UseFromLocation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateProperties.json.cs new file mode 100644 index 000000000000..be508f3d15a0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CacheUpdateProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Cache operation. + public partial class CacheUpdateProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CacheUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_connectionString = If( json?.PropertyT("connectionString"), out var __jsonConnectionString) ? (string)__jsonConnectionString : (string)ConnectionString;} + {_useFromLocation = If( json?.PropertyT("useFromLocation"), out var __jsonUseFromLocation) ? (string)__jsonUseFromLocation : (string)UseFromLocation;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICacheUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CacheUpdateProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._connectionString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._connectionString.ToString()) : null, "connectionString" ,container.Add ); + AddIf( null != (((object)this._useFromLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._useFromLocation.ToString()) : null, "useFromLocation" ,container.Add ); + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCollection.cs new file mode 100644 index 000000000000..714dc0a90dbf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Certificates list representation. + public partial class CertificateCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public CertificateCollection() + { + + } + } + /// Paged Certificates list representation. + public partial interface ICertificateCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContract[] Value { get; set; } + + } + /// Paged Certificates list representation. + internal partial interface ICertificateCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCollection.json.cs new file mode 100644 index 000000000000..1477229d959c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Certificates list representation. + public partial class CertificateCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CertificateCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CertificateCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateConfiguration.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateConfiguration.cs new file mode 100644 index 000000000000..d5041121130e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateConfiguration.cs @@ -0,0 +1,159 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Certificate configuration which consist of non-trusted intermediates and root certificates. + /// + public partial class CertificateConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation _certificate; + + /// Certificate information. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateInformation()); set => this._certificate = value; } + + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? CertificateExpiry { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Expiry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Expiry = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _certificatePassword; + + /// Certificate Password. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string CertificatePassword { get => this._certificatePassword; set => this._certificatePassword = value; } + + /// Subject of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string CertificateSubject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Subject = value ?? null; } + + /// Thumbprint of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string CertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Thumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Thumbprint = value ?? null; } + + /// Backing field for property. + private string _encodedCertificate; + + /// Base64 Encoded certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string EncodedCertificate { get => this._encodedCertificate; set => this._encodedCertificate = value; } + + /// Internal Acessors for Certificate + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfigurationInternal.Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateInformation()); set { {_certificate = value;} } } + + /// Backing field for property. + private string _storeName; + + /// + /// The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority + /// are valid locations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string StoreName { get => this._storeName; set => this._storeName = value; } + + /// Creates an new instance. + public CertificateConfiguration() + { + + } + } + /// Certificate configuration which consist of non-trusted intermediates and root certificates. + public partial interface ICertificateConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.", + SerializedName = @"expiry", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CertificateExpiry { get; set; } + /// Certificate Password. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate Password.", + SerializedName = @"certificatePassword", + PossibleTypes = new [] { typeof(string) })] + string CertificatePassword { get; set; } + /// Subject of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subject of the certificate.", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string CertificateSubject { get; set; } + /// Thumbprint of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint of the certificate.", + SerializedName = @"thumbprint", + PossibleTypes = new [] { typeof(string) })] + string CertificateThumbprint { get; set; } + /// Base64 Encoded certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Base64 Encoded certificate.", + SerializedName = @"encodedCertificate", + PossibleTypes = new [] { typeof(string) })] + string EncodedCertificate { get; set; } + /// + /// The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority + /// are valid locations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations.", + SerializedName = @"storeName", + PossibleTypes = new [] { typeof(string) })] + string StoreName { get; set; } + + } + /// Certificate configuration which consist of non-trusted intermediates and root certificates. + internal partial interface ICertificateConfigurationInternal + + { + /// Certificate information. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation Certificate { get; set; } + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + global::System.DateTime? CertificateExpiry { get; set; } + /// Certificate Password. + string CertificatePassword { get; set; } + /// Subject of the certificate. + string CertificateSubject { get; set; } + /// Thumbprint of the certificate. + string CertificateThumbprint { get; set; } + /// Base64 Encoded certificate. + string EncodedCertificate { get; set; } + /// + /// The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority + /// are valid locations. + /// + string StoreName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateConfiguration.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateConfiguration.json.cs new file mode 100644 index 000000000000..8c6b4ea3e776 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateConfiguration.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Certificate configuration which consist of non-trusted intermediates and root certificates. + /// + public partial class CertificateConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CertificateConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_certificate = If( json?.PropertyT("certificate"), out var __jsonCertificate) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateInformation.FromJson(__jsonCertificate) : Certificate;} + {_encodedCertificate = If( json?.PropertyT("encodedCertificate"), out var __jsonEncodedCertificate) ? (string)__jsonEncodedCertificate : (string)EncodedCertificate;} + {_certificatePassword = If( json?.PropertyT("certificatePassword"), out var __jsonCertificatePassword) ? (string)__jsonCertificatePassword : (string)CertificatePassword;} + {_storeName = If( json?.PropertyT("storeName"), out var __jsonStoreName) ? (string)__jsonStoreName : (string)StoreName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CertificateConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._certificate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._certificate.ToJson(null,serializationMode) : null, "certificate" ,container.Add ); + AddIf( null != (((object)this._encodedCertificate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._encodedCertificate.ToString()) : null, "encodedCertificate" ,container.Add ); + AddIf( null != (((object)this._certificatePassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._certificatePassword.ToString()) : null, "certificatePassword" ,container.Add ); + AddIf( null != (((object)this._storeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._storeName.ToString()) : null, "storeName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContract.cs new file mode 100644 index 000000000000..36a4e064a93c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContract.cs @@ -0,0 +1,270 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Certificate details. + public partial class CertificateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).ExpirationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).ExpirationDate = value ?? default(global::System.DateTime); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).KeyVaultIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).KeyVaultIdentityClientId = value ?? null; } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultSecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).KeyVaultSecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).KeyVaultSecretIdentifier = value ?? null; } + + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).LastStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).LastStatusCode = value ?? null; } + + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).LastStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).LastStatusMessage = value ?? null; } + + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? LastStatusTimeStampUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).LastStatusTimeStampUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).LastStatusTimeStampUtc = value ?? default(global::System.DateTime); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractInternal.KeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).KeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).KeyVault = value; } + + /// Internal Acessors for KeyVaultLastStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractInternal.KeyVaultLastStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).KeyVaultLastStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).KeyVaultLastStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractProperties _property; + + /// Certificate properties details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateContractProperties()); set => this._property = value; } + + /// Subject attribute of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Subject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).Subject = value ?? null; } + + /// Thumbprint of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Thumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).Thumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal)Property).Thumbprint = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public CertificateContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Certificate details. + public partial interface ICertificateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"expirationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationDate { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultSecretIdentifier { get; set; } + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last status code for sync and refresh of secret from key vault.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string LastStatusCode { get; set; } + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Details of the error else empty.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string LastStatusMessage { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"timeStampUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastStatusTimeStampUtc { get; set; } + /// Subject attribute of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subject attribute of the certificate.", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string Subject { get; set; } + /// Thumbprint of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint of the certificate.", + SerializedName = @"thumbprint", + PossibleTypes = new [] { typeof(string) })] + string Thumbprint { get; set; } + + } + /// Certificate details. + internal partial interface ICertificateContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + global::System.DateTime? ExpirationDate { get; set; } + /// KeyVault location details of the certificate. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties KeyVault { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string KeyVaultIdentityClientId { get; set; } + /// Last time sync and refresh status of secret from key vault. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties KeyVaultLastStatus { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string KeyVaultSecretIdentifier { get; set; } + /// Last status code for sync and refresh of secret from key vault. + string LastStatusCode { get; set; } + /// Details of the error else empty. + string LastStatusMessage { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? LastStatusTimeStampUtc { get; set; } + /// Certificate properties details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractProperties Property { get; set; } + /// Subject attribute of the certificate. + string Subject { get; set; } + /// Thumbprint of the certificate. + string Thumbprint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContract.json.cs new file mode 100644 index 000000000000..381890d5a439 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Certificate details. + public partial class CertificateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CertificateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CertificateContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContractProperties.cs new file mode 100644 index 000000000000..279c6736e4ee --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContractProperties.cs @@ -0,0 +1,207 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Certificate contract. + public partial class CertificateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime _expirationDate; + + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime ExpirationDate { get => this._expirationDate; set => this._expirationDate = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties _keyVault; + + /// KeyVault location details of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractProperties()); set => this._keyVault = value; } + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId = value ?? null; } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultSecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier = value ?? null; } + + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusCode = value ?? null; } + + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusMessage = value ?? null; } + + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? LastStatusTimeStampUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusTimeStampUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusTimeStampUtc = value ?? default(global::System.DateTime); } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal.KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractProperties()); set { {_keyVault = value;} } } + + /// Internal Acessors for KeyVaultLastStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractPropertiesInternal.KeyVaultLastStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatus = value; } + + /// Backing field for property. + private string _subject; + + /// Subject attribute of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Subject { get => this._subject; set => this._subject = value; } + + /// Backing field for property. + private string _thumbprint; + + /// Thumbprint of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Thumbprint { get => this._thumbprint; set => this._thumbprint = value; } + + /// Creates an new instance. + public CertificateContractProperties() + { + + } + } + /// Properties of the Certificate contract. + public partial interface ICertificateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"expirationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime ExpirationDate { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultSecretIdentifier { get; set; } + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last status code for sync and refresh of secret from key vault.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string LastStatusCode { get; set; } + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Details of the error else empty.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string LastStatusMessage { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"timeStampUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastStatusTimeStampUtc { get; set; } + /// Subject attribute of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subject attribute of the certificate.", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string Subject { get; set; } + /// Thumbprint of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Thumbprint of the certificate.", + SerializedName = @"thumbprint", + PossibleTypes = new [] { typeof(string) })] + string Thumbprint { get; set; } + + } + /// Properties of the Certificate contract. + internal partial interface ICertificateContractPropertiesInternal + + { + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + global::System.DateTime ExpirationDate { get; set; } + /// KeyVault location details of the certificate. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties KeyVault { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string KeyVaultIdentityClientId { get; set; } + /// Last time sync and refresh status of secret from key vault. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties KeyVaultLastStatus { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string KeyVaultSecretIdentifier { get; set; } + /// Last status code for sync and refresh of secret from key vault. + string LastStatusCode { get; set; } + /// Details of the error else empty. + string LastStatusMessage { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? LastStatusTimeStampUtc { get; set; } + /// Subject attribute of the certificate. + string Subject { get; set; } + /// Thumbprint of the certificate. + string Thumbprint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContractProperties.json.cs new file mode 100644 index 000000000000..4bd2f744d943 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateContractProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Certificate contract. + public partial class CertificateContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CertificateContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyVault = If( json?.PropertyT("keyVault"), out var __jsonKeyVault) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractProperties.FromJson(__jsonKeyVault) : KeyVault;} + {_subject = If( json?.PropertyT("subject"), out var __jsonSubject) ? (string)__jsonSubject : (string)Subject;} + {_thumbprint = If( json?.PropertyT("thumbprint"), out var __jsonThumbprint) ? (string)__jsonThumbprint : (string)Thumbprint;} + {_expirationDate = If( json?.PropertyT("expirationDate"), out var __jsonExpirationDate) ? global::System.DateTime.TryParse((string)__jsonExpirationDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationDateValue) ? __jsonExpirationDateValue : ExpirationDate : ExpirationDate;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CertificateContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._keyVault ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._keyVault.ToJson(null,serializationMode) : null, "keyVault" ,container.Add ); + AddIf( null != (((object)this._subject)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._subject.ToString()) : null, "subject" ,container.Add ); + AddIf( null != (((object)this._thumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._thumbprint.ToString()) : null, "thumbprint" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._expirationDate.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "expirationDate" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateParameters.cs new file mode 100644 index 000000000000..c59f6086465f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateParameters.cs @@ -0,0 +1,122 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Certificate create or update details. + public partial class CertificateCreateOrUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateParametersInternal + { + + /// Base 64 encoded certificate using the application/x-pkcs12 representation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Data { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal)Property).Data; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal)Property).Data = value ?? null; } + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVaultIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVaultIdentityClientId = value ?? null; } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultSecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVaultSecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVaultSecretIdentifier = value ?? null; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateParametersInternal.KeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal)Property).KeyVault = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateCreateOrUpdateProperties()); set { {_property = value;} } } + + /// Password for the Certificate + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal)Property).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal)Property).Password = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateProperties _property; + + /// Certificate create or update properties details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateCreateOrUpdateProperties()); set => this._property = value; } + + /// Creates an new instance. + public CertificateCreateOrUpdateParameters() + { + + } + } + /// Certificate create or update details. + public partial interface ICertificateCreateOrUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Base 64 encoded certificate using the application/x-pkcs12 representation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Base 64 encoded certificate using the application/x-pkcs12 representation.", + SerializedName = @"data", + PossibleTypes = new [] { typeof(string) })] + string Data { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultSecretIdentifier { get; set; } + /// Password for the Certificate + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for the Certificate", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string Password { get; set; } + + } + /// Certificate create or update details. + internal partial interface ICertificateCreateOrUpdateParametersInternal + + { + /// Base 64 encoded certificate using the application/x-pkcs12 representation. + string Data { get; set; } + /// KeyVault location details of the certificate. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties KeyVault { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string KeyVaultSecretIdentifier { get; set; } + /// Password for the Certificate + string Password { get; set; } + /// Certificate create or update properties details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateParameters.json.cs new file mode 100644 index 000000000000..ea9b4b479e49 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateParameters.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Certificate create or update details. + public partial class CertificateCreateOrUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CertificateCreateOrUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateCreateOrUpdateProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CertificateCreateOrUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateProperties.cs new file mode 100644 index 000000000000..5bb1f6cda017 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateProperties.cs @@ -0,0 +1,123 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the CreateOrUpdate certificate operation. + public partial class CertificateCreateOrUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal + { + + /// Backing field for property. + private string _data; + + /// Base 64 encoded certificate using the application/x-pkcs12 representation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Data { get => this._data; set => this._data = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties _keyVault; + + /// KeyVault location details of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties()); set => this._keyVault = value; } + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId = value ?? null; } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultSecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier = value ?? null; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdatePropertiesInternal.KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties()); set { {_keyVault = value;} } } + + /// Backing field for property. + private string _password; + + /// Password for the Certificate + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Password { get => this._password; set => this._password = value; } + + /// Creates an new instance. + public CertificateCreateOrUpdateProperties() + { + + } + } + /// Parameters supplied to the CreateOrUpdate certificate operation. + public partial interface ICertificateCreateOrUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Base 64 encoded certificate using the application/x-pkcs12 representation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Base 64 encoded certificate using the application/x-pkcs12 representation.", + SerializedName = @"data", + PossibleTypes = new [] { typeof(string) })] + string Data { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultSecretIdentifier { get; set; } + /// Password for the Certificate + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password for the Certificate", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string Password { get; set; } + + } + /// Parameters supplied to the CreateOrUpdate certificate operation. + internal partial interface ICertificateCreateOrUpdatePropertiesInternal + + { + /// Base 64 encoded certificate using the application/x-pkcs12 representation. + string Data { get; set; } + /// KeyVault location details of the certificate. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties KeyVault { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string KeyVaultSecretIdentifier { get; set; } + /// Password for the Certificate + string Password { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateProperties.json.cs new file mode 100644 index 000000000000..12063c6f859a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateCreateOrUpdateProperties.json.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the CreateOrUpdate certificate operation. + public partial class CertificateCreateOrUpdateProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CertificateCreateOrUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyVault = If( json?.PropertyT("keyVault"), out var __jsonKeyVault) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties.FromJson(__jsonKeyVault) : KeyVault;} + {_data = If( json?.PropertyT("data"), out var __jsonData) ? (string)__jsonData : (string)Data;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateCreateOrUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CertificateCreateOrUpdateProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._keyVault ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._keyVault.ToJson(null,serializationMode) : null, "keyVault" ,container.Add ); + AddIf( null != (((object)this._data)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._data.ToString()) : null, "data" ,container.Add ); + AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._password.ToString()) : null, "password" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateInformation.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateInformation.cs new file mode 100644 index 000000000000..3ec6e1da873a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateInformation.cs @@ -0,0 +1,94 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// SSL certificate information. + public partial class CertificateInformation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal + { + + /// Backing field for property. + private global::System.DateTime _expiry; + + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime Expiry { get => this._expiry; set => this._expiry = value; } + + /// Backing field for property. + private string _subject; + + /// Subject of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Subject { get => this._subject; set => this._subject = value; } + + /// Backing field for property. + private string _thumbprint; + + /// Thumbprint of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Thumbprint { get => this._thumbprint; set => this._thumbprint = value; } + + /// Creates an new instance. + public CertificateInformation() + { + + } + } + /// SSL certificate information. + public partial interface ICertificateInformation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.", + SerializedName = @"expiry", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime Expiry { get; set; } + /// Subject of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subject of the certificate.", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string Subject { get; set; } + /// Thumbprint of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Thumbprint of the certificate.", + SerializedName = @"thumbprint", + PossibleTypes = new [] { typeof(string) })] + string Thumbprint { get; set; } + + } + /// SSL certificate information. + internal partial interface ICertificateInformationInternal + + { + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + global::System.DateTime Expiry { get; set; } + /// Subject of the certificate. + string Subject { get; set; } + /// Thumbprint of the certificate. + string Thumbprint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateInformation.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateInformation.json.cs new file mode 100644 index 000000000000..d0235352fb08 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CertificateInformation.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// SSL certificate information. + public partial class CertificateInformation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CertificateInformation(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_expiry = If( json?.PropertyT("expiry"), out var __jsonExpiry) ? global::System.DateTime.TryParse((string)__jsonExpiry, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryValue) ? __jsonExpiryValue : Expiry : Expiry;} + {_thumbprint = If( json?.PropertyT("thumbprint"), out var __jsonThumbprint) ? (string)__jsonThumbprint : (string)Thumbprint;} + {_subject = If( json?.PropertyT("subject"), out var __jsonSubject) ? (string)__jsonSubject : (string)Subject;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CertificateInformation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._expiry.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "expiry" ,container.Add ); + AddIf( null != (((object)this._thumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._thumbprint.ToString()) : null, "thumbprint" ,container.Add ); + AddIf( null != (((object)this._subject)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._subject.ToString()) : null, "subject" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerFailureCondition.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerFailureCondition.cs new file mode 100644 index 000000000000..73b90dbfa5f5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerFailureCondition.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The trip conditions of the circuit breaker + public partial class CircuitBreakerFailureCondition : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureCondition, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal + { + + /// Backing field for property. + private long? _count; + + /// The threshold for opening the circuit. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string[] _errorReason; + + /// The error reasons which are considered as failure. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] ErrorReason { get => this._errorReason; set => this._errorReason = value; } + + /// Backing field for property. + private global::System.TimeSpan? _interval; + + /// The interval during which the failures are counted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.TimeSpan? Interval { get => this._interval; set => this._interval = value; } + + /// Backing field for property. + private long? _percentage; + + /// The threshold for opening the circuit. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Percentage { get => this._percentage; set => this._percentage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange[] _statusCodeRange; + + /// The status code ranges which are considered as failure. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange[] StatusCodeRange { get => this._statusCodeRange; set => this._statusCodeRange = value; } + + /// Creates an new instance. + public CircuitBreakerFailureCondition() + { + + } + } + /// The trip conditions of the circuit breaker + public partial interface ICircuitBreakerFailureCondition : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The threshold for opening the circuit. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The threshold for opening the circuit.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// The error reasons which are considered as failure. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The error reasons which are considered as failure.", + SerializedName = @"errorReasons", + PossibleTypes = new [] { typeof(string) })] + string[] ErrorReason { get; set; } + /// The interval during which the failures are counted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The interval during which the failures are counted.", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? Interval { get; set; } + /// The threshold for opening the circuit. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The threshold for opening the circuit.", + SerializedName = @"percentage", + PossibleTypes = new [] { typeof(long) })] + long? Percentage { get; set; } + /// The status code ranges which are considered as failure. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status code ranges which are considered as failure.", + SerializedName = @"statusCodeRanges", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange[] StatusCodeRange { get; set; } + + } + /// The trip conditions of the circuit breaker + internal partial interface ICircuitBreakerFailureConditionInternal + + { + /// The threshold for opening the circuit. + long? Count { get; set; } + /// The error reasons which are considered as failure. + string[] ErrorReason { get; set; } + /// The interval during which the failures are counted. + global::System.TimeSpan? Interval { get; set; } + /// The threshold for opening the circuit. + long? Percentage { get; set; } + /// The status code ranges which are considered as failure. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange[] StatusCodeRange { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerFailureCondition.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerFailureCondition.json.cs new file mode 100644 index 000000000000..7965263dbf46 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerFailureCondition.json.cs @@ -0,0 +1,132 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The trip conditions of the circuit breaker + public partial class CircuitBreakerFailureCondition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CircuitBreakerFailureCondition(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_percentage = If( json?.PropertyT("percentage"), out var __jsonPercentage) ? (long?)__jsonPercentage : Percentage;} + {_interval = If( json?.PropertyT("interval"), out var __jsonInterval) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonInterval ) : Interval;} + {_statusCodeRange = If( json?.PropertyT("statusCodeRanges"), out var __jsonStatusCodeRanges) ? If( __jsonStatusCodeRanges as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.FailureStatusCodeRange.FromJson(__u) )) ))() : null : StatusCodeRange;} + {_errorReason = If( json?.PropertyT("errorReasons"), out var __jsonErrorReasons) ? If( __jsonErrorReasons as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ErrorReason;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureCondition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureCondition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CircuitBreakerFailureCondition(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != this._percentage ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._percentage) : null, "percentage" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)(null != this._interval ? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._interval)): null), "interval" ,container.Add ); + if (null != this._statusCodeRange) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._statusCodeRange ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("statusCodeRanges",__w); + } + if (null != this._errorReason) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._errorReason ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("errorReasons",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerRule.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerRule.cs new file mode 100644 index 000000000000..732108d8cdf0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerRule.cs @@ -0,0 +1,150 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Rule configuration to trip the backend. + public partial class CircuitBreakerRule : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRuleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureCondition _failureCondition; + + /// The conditions for tripping the circuit breaker. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureCondition FailureCondition { get => (this._failureCondition = this._failureCondition ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CircuitBreakerFailureCondition()); set => this._failureCondition = value; } + + /// The threshold for opening the circuit. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public long? FailureConditionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal)FailureCondition).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal)FailureCondition).Count = value ?? default(long); } + + /// The error reasons which are considered as failure. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] FailureConditionErrorReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal)FailureCondition).ErrorReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal)FailureCondition).ErrorReason = value ?? null /* arrayOf */; } + + /// The interval during which the failures are counted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.TimeSpan? FailureConditionInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal)FailureCondition).Interval; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal)FailureCondition).Interval = value ?? default(global::System.TimeSpan); } + + /// The threshold for opening the circuit. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public long? FailureConditionPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal)FailureCondition).Percentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal)FailureCondition).Percentage = value ?? default(long); } + + /// The status code ranges which are considered as failure. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange[] FailureConditionStatusCodeRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal)FailureCondition).StatusCodeRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureConditionInternal)FailureCondition).StatusCodeRange = value ?? null /* arrayOf */; } + + /// Internal Acessors for FailureCondition + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureCondition Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRuleInternal.FailureCondition { get => (this._failureCondition = this._failureCondition ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CircuitBreakerFailureCondition()); set { {_failureCondition = value;} } } + + /// Backing field for property. + private string _name; + + /// The rule name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private global::System.TimeSpan? _tripDuration; + + /// The duration for which the circuit will be tripped. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.TimeSpan? TripDuration { get => this._tripDuration; set => this._tripDuration = value; } + + /// Creates an new instance. + public CircuitBreakerRule() + { + + } + } + /// Rule configuration to trip the backend. + public partial interface ICircuitBreakerRule : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The threshold for opening the circuit. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The threshold for opening the circuit.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? FailureConditionCount { get; set; } + /// The error reasons which are considered as failure. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The error reasons which are considered as failure.", + SerializedName = @"errorReasons", + PossibleTypes = new [] { typeof(string) })] + string[] FailureConditionErrorReason { get; set; } + /// The interval during which the failures are counted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The interval during which the failures are counted.", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? FailureConditionInterval { get; set; } + /// The threshold for opening the circuit. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The threshold for opening the circuit.", + SerializedName = @"percentage", + PossibleTypes = new [] { typeof(long) })] + long? FailureConditionPercentage { get; set; } + /// The status code ranges which are considered as failure. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status code ranges which are considered as failure.", + SerializedName = @"statusCodeRanges", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange[] FailureConditionStatusCodeRange { get; set; } + /// The rule name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The rule name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The duration for which the circuit will be tripped. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The duration for which the circuit will be tripped.", + SerializedName = @"tripDuration", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? TripDuration { get; set; } + + } + /// Rule configuration to trip the backend. + internal partial interface ICircuitBreakerRuleInternal + + { + /// The conditions for tripping the circuit breaker. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerFailureCondition FailureCondition { get; set; } + /// The threshold for opening the circuit. + long? FailureConditionCount { get; set; } + /// The error reasons which are considered as failure. + string[] FailureConditionErrorReason { get; set; } + /// The interval during which the failures are counted. + global::System.TimeSpan? FailureConditionInterval { get; set; } + /// The threshold for opening the circuit. + long? FailureConditionPercentage { get; set; } + /// The status code ranges which are considered as failure. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange[] FailureConditionStatusCodeRange { get; set; } + /// The rule name. + string Name { get; set; } + /// The duration for which the circuit will be tripped. + global::System.TimeSpan? TripDuration { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerRule.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerRule.json.cs new file mode 100644 index 000000000000..4cfe08cb3fbc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/CircuitBreakerRule.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Rule configuration to trip the backend. + public partial class CircuitBreakerRule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CircuitBreakerRule(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_failureCondition = If( json?.PropertyT("failureCondition"), out var __jsonFailureCondition) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CircuitBreakerFailureCondition.FromJson(__jsonFailureCondition) : FailureCondition;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_tripDuration = If( json?.PropertyT("tripDuration"), out var __jsonTripDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonTripDuration ) : TripDuration;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICircuitBreakerRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CircuitBreakerRule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._failureCondition ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._failureCondition.ToJson(null,serializationMode) : null, "failureCondition" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)(null != this._tripDuration ? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._tripDuration)): null), "tripDuration" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ClientSecretContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ClientSecretContract.cs new file mode 100644 index 000000000000..ca03264f4b24 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ClientSecretContract.cs @@ -0,0 +1,77 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + public partial class ClientSecretContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IClientSecretContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IClientSecretContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _clientSecret; + + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientSecret { get => this._clientSecret; set => this._clientSecret = value; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public ClientSecretContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IClientSecretContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + public partial interface IClientSecretContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client or app secret used in IdentityProviders, Aad, OpenID or OAuth.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + internal partial interface IClientSecretContractInternal + + { + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + string ClientSecret { get; set; } + + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ClientSecretContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ClientSecretContract.json.cs new file mode 100644 index 000000000000..93601168848a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ClientSecretContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + public partial class ClientSecretContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ClientSecretContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IClientSecretContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IClientSecretContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IClientSecretContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ClientSecretContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._clientSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientSecret.ToString()) : null, "clientSecret" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConfigurationApi.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConfigurationApi.cs new file mode 100644 index 000000000000..18e3377ef951 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConfigurationApi.cs @@ -0,0 +1,63 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Information regarding the Configuration API of the API Management service. + public partial class ConfigurationApi : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApiInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? _legacyApi; + + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? LegacyApi { get => this._legacyApi; set => this._legacyApi = value; } + + /// Creates an new instance. + public ConfigurationApi() + { + + } + } + /// Information regarding the Configuration API of the API Management service. + public partial interface IConfigurationApi : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted gateways. Default value is 'Enabled'", + SerializedName = @"legacyApi", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? LegacyApi { get; set; } + + } + /// Information regarding the Configuration API of the API Management service. + internal partial interface IConfigurationApiInternal + + { + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState? LegacyApi { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConfigurationApi.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConfigurationApi.json.cs new file mode 100644 index 000000000000..88157756ad9d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConfigurationApi.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Information regarding the Configuration API of the API Management service. + public partial class ConfigurationApi + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ConfigurationApi(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_legacyApi = If( json?.PropertyT("legacyApi"), out var __jsonLegacyApi) ? (string)__jsonLegacyApi : (string)LegacyApi;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConfigurationApi FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ConfigurationApi(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._legacyApi)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._legacyApi.ToString()) : null, "legacyApi" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequest.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequest.cs new file mode 100644 index 000000000000..68ebdaf8df2d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequest.cs @@ -0,0 +1,224 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// A request to perform the connectivity check operation on a API Management service. + /// + public partial class ConnectivityCheckRequest : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequest, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestination _destination; + + /// The connectivity check operation destination. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestination Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestDestination()); set => this._destination = value; } + + /// Destination address. Can either be an IP address or a FQDN. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DestinationAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestinationInternal)Destination).Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestinationInternal)Destination).Address = value ; } + + /// Destination port. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public long DestinationPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestinationInternal)Destination).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestinationInternal)Destination).Port = value ; } + + /// List of headers to be included in the request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader[] HttpConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfigurationHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfigurationHeader = value ?? null /* arrayOf */; } + + /// The HTTP method to be used. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method? HttpConfigurationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfigurationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfigurationMethod = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method)""); } + + /// List of HTTP status codes considered valid for the request response. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public long[] HttpConfigurationValidStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfigurationValidStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfigurationValidStatusCode = value ?? null /* arrayOf */; } + + /// Internal Acessors for Destination + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestination Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestInternal.Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestDestination()); set { {_destination = value;} } } + + /// Internal Acessors for ProtocolConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestInternal.ProtocolConfiguration { get => (this._protocolConfiguration = this._protocolConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestProtocolConfiguration()); set { {_protocolConfiguration = value;} } } + + /// Internal Acessors for ProtocolConfigurationHttpConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestInternal.ProtocolConfigurationHttpConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationInternal)ProtocolConfiguration).HttpConfiguration = value; } + + /// Internal Acessors for Source + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSource Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestInternal.Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestSource()); set { {_source = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion? _preferredIPVersion; + + /// The IP version to be used. Only IPv4 is supported for now. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion? PreferredIPVersion { get => this._preferredIPVersion; set => this._preferredIPVersion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol? _protocol; + + /// + /// The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination + /// address must be coherent with this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol? Protocol { get => this._protocol; set => this._protocol = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfiguration _protocolConfiguration; + + /// Protocol-specific configuration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfiguration ProtocolConfiguration { get => (this._protocolConfiguration = this._protocolConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestProtocolConfiguration()); set => this._protocolConfiguration = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSource _source; + + /// Definitions about the connectivity check origin. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSource Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestSource()); set => this._source = value; } + + /// The particular VMSS instance from which to fire the request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public long? SourceInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSourceInternal)Source).Instance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSourceInternal)Source).Instance = value ?? default(long); } + + /// + /// The API Management service region from where to start the connectivity check operation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SourceRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSourceInternal)Source).Region; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSourceInternal)Source).Region = value ; } + + /// Creates an new instance. + public ConnectivityCheckRequest() + { + + } + } + /// A request to perform the connectivity check operation on a API Management service. + public partial interface IConnectivityCheckRequest : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Destination address. Can either be an IP address or a FQDN. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Destination address. Can either be an IP address or a FQDN.", + SerializedName = @"address", + PossibleTypes = new [] { typeof(string) })] + string DestinationAddress { get; set; } + /// Destination port. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Destination port.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long DestinationPort { get; set; } + /// List of headers to be included in the request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of headers to be included in the request.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader[] HttpConfigurationHeader { get; set; } + /// The HTTP method to be used. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTP method to be used.", + SerializedName = @"method", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method? HttpConfigurationMethod { get; set; } + /// List of HTTP status codes considered valid for the request response. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of HTTP status codes considered valid for the request response.", + SerializedName = @"validStatusCodes", + PossibleTypes = new [] { typeof(long) })] + long[] HttpConfigurationValidStatusCode { get; set; } + /// The IP version to be used. Only IPv4 is supported for now. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IP version to be used. Only IPv4 is supported for now.", + SerializedName = @"preferredIPVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion? PreferredIPVersion { get; set; } + /// + /// The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination + /// address must be coherent with this value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination address must be coherent with this value.", + SerializedName = @"protocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol? Protocol { get; set; } + /// The particular VMSS instance from which to fire the request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The particular VMSS instance from which to fire the request.", + SerializedName = @"instance", + PossibleTypes = new [] { typeof(long) })] + long? SourceInstance { get; set; } + /// + /// The API Management service region from where to start the connectivity check operation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The API Management service region from where to start the connectivity check operation.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string SourceRegion { get; set; } + + } + /// A request to perform the connectivity check operation on a API Management service. + internal partial interface IConnectivityCheckRequestInternal + + { + /// The connectivity check operation destination. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestination Destination { get; set; } + /// Destination address. Can either be an IP address or a FQDN. + string DestinationAddress { get; set; } + /// Destination port. + long DestinationPort { get; set; } + /// List of headers to be included in the request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader[] HttpConfigurationHeader { get; set; } + /// The HTTP method to be used. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method? HttpConfigurationMethod { get; set; } + /// List of HTTP status codes considered valid for the request response. + long[] HttpConfigurationValidStatusCode { get; set; } + /// The IP version to be used. Only IPv4 is supported for now. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion? PreferredIPVersion { get; set; } + /// + /// The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination + /// address must be coherent with this value. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol? Protocol { get; set; } + /// Protocol-specific configuration. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfiguration ProtocolConfiguration { get; set; } + /// Configuration for HTTP or HTTPS requests. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration ProtocolConfigurationHttpConfiguration { get; set; } + /// Definitions about the connectivity check origin. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSource Source { get; set; } + /// The particular VMSS instance from which to fire the request. + long? SourceInstance { get; set; } + /// + /// The API Management service region from where to start the connectivity check operation. + /// + string SourceRegion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequest.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequest.json.cs new file mode 100644 index 000000000000..ed6abd6da353 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequest.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// A request to perform the connectivity check operation on a API Management service. + /// + public partial class ConnectivityCheckRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectivityCheckRequest(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestSource.FromJson(__jsonSource) : Source;} + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestDestination.FromJson(__jsonDestination) : Destination;} + {_protocolConfiguration = If( json?.PropertyT("protocolConfiguration"), out var __jsonProtocolConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestProtocolConfiguration.FromJson(__jsonProtocolConfiguration) : ProtocolConfiguration;} + {_preferredIPVersion = If( json?.PropertyT("preferredIPVersion"), out var __jsonPreferredIPVersion) ? (string)__jsonPreferredIPVersion : (string)PreferredIPVersion;} + {_protocol = If( json?.PropertyT("protocol"), out var __jsonProtocol) ? (string)__jsonProtocol : (string)Protocol;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ConnectivityCheckRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._source ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._source.ToJson(null,serializationMode) : null, "source" ,container.Add ); + AddIf( null != this._destination ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._destination.ToJson(null,serializationMode) : null, "destination" ,container.Add ); + AddIf( null != this._protocolConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._protocolConfiguration.ToJson(null,serializationMode) : null, "protocolConfiguration" ,container.Add ); + AddIf( null != (((object)this._preferredIPVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._preferredIPVersion.ToString()) : null, "preferredIPVersion" ,container.Add ); + AddIf( null != (((object)this._protocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._protocol.ToString()) : null, "protocol" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestDestination.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestDestination.cs new file mode 100644 index 000000000000..cf813587c6c0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestDestination.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The connectivity check operation destination. + public partial class ConnectivityCheckRequestDestination : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestination, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestinationInternal + { + + /// Backing field for property. + private string _address; + + /// Destination address. Can either be an IP address or a FQDN. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Address { get => this._address; set => this._address = value; } + + /// Backing field for property. + private long _port; + + /// Destination port. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long Port { get => this._port; set => this._port = value; } + + /// Creates an new instance. + public ConnectivityCheckRequestDestination() + { + + } + } + /// The connectivity check operation destination. + public partial interface IConnectivityCheckRequestDestination : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Destination address. Can either be an IP address or a FQDN. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Destination address. Can either be an IP address or a FQDN.", + SerializedName = @"address", + PossibleTypes = new [] { typeof(string) })] + string Address { get; set; } + /// Destination port. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Destination port.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long Port { get; set; } + + } + /// The connectivity check operation destination. + internal partial interface IConnectivityCheckRequestDestinationInternal + + { + /// Destination address. Can either be an IP address or a FQDN. + string Address { get; set; } + /// Destination port. + long Port { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestDestination.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestDestination.json.cs new file mode 100644 index 000000000000..23934c36335c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestDestination.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The connectivity check operation destination. + public partial class ConnectivityCheckRequestDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectivityCheckRequestDestination(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_address = If( json?.PropertyT("address"), out var __jsonAddress) ? (string)__jsonAddress : (string)Address;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (long)__jsonPort : Port;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ConnectivityCheckRequestDestination(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._address)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._address.ToString()) : null, "address" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber(this._port), "port" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfiguration.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfiguration.cs new file mode 100644 index 000000000000..d046ae1b76de --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfiguration.cs @@ -0,0 +1,90 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Protocol-specific configuration. + public partial class ConnectivityCheckRequestProtocolConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration _httpConfiguration; + + /// Configuration for HTTP or HTTPS requests. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration HttpConfiguration { get => (this._httpConfiguration = this._httpConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestProtocolConfigurationHttpConfiguration()); set => this._httpConfiguration = value; } + + /// List of headers to be included in the request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader[] HttpConfigurationHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal)HttpConfiguration).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal)HttpConfiguration).Header = value ?? null /* arrayOf */; } + + /// The HTTP method to be used. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method? HttpConfigurationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal)HttpConfiguration).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal)HttpConfiguration).Method = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method)""); } + + /// List of HTTP status codes considered valid for the request response. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public long[] HttpConfigurationValidStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal)HttpConfiguration).ValidStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal)HttpConfiguration).ValidStatusCode = value ?? null /* arrayOf */; } + + /// Internal Acessors for HttpConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationInternal.HttpConfiguration { get => (this._httpConfiguration = this._httpConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestProtocolConfigurationHttpConfiguration()); set { {_httpConfiguration = value;} } } + + /// + /// Creates an new instance. + /// + public ConnectivityCheckRequestProtocolConfiguration() + { + + } + } + /// Protocol-specific configuration. + public partial interface IConnectivityCheckRequestProtocolConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// List of headers to be included in the request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of headers to be included in the request.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader[] HttpConfigurationHeader { get; set; } + /// The HTTP method to be used. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTP method to be used.", + SerializedName = @"method", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method? HttpConfigurationMethod { get; set; } + /// List of HTTP status codes considered valid for the request response. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of HTTP status codes considered valid for the request response.", + SerializedName = @"validStatusCodes", + PossibleTypes = new [] { typeof(long) })] + long[] HttpConfigurationValidStatusCode { get; set; } + + } + /// Protocol-specific configuration. + internal partial interface IConnectivityCheckRequestProtocolConfigurationInternal + + { + /// Configuration for HTTP or HTTPS requests. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration HttpConfiguration { get; set; } + /// List of headers to be included in the request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader[] HttpConfigurationHeader { get; set; } + /// The HTTP method to be used. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method? HttpConfigurationMethod { get; set; } + /// List of HTTP status codes considered valid for the request response. + long[] HttpConfigurationValidStatusCode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfiguration.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfiguration.json.cs new file mode 100644 index 000000000000..10bac482972b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfiguration.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Protocol-specific configuration. + public partial class ConnectivityCheckRequestProtocolConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectivityCheckRequestProtocolConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_httpConfiguration = If( json?.PropertyT("HTTPConfiguration"), out var __jsonHttpConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.FromJson(__jsonHttpConfiguration) : HttpConfiguration;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ConnectivityCheckRequestProtocolConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._httpConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._httpConfiguration.ToJson(null,serializationMode) : null, "HTTPConfiguration" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.cs new file mode 100644 index 000000000000..033ee9424804 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.cs @@ -0,0 +1,87 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Configuration for HTTP or HTTPS requests. + public partial class ConnectivityCheckRequestProtocolConfigurationHttpConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader[] _header; + + /// List of headers to be included in the request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader[] Header { get => this._header; set => this._header = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method? _method; + + /// The HTTP method to be used. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method? Method { get => this._method; set => this._method = value; } + + /// Backing field for property. + private long[] _validStatusCode; + + /// List of HTTP status codes considered valid for the request response. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long[] ValidStatusCode { get => this._validStatusCode; set => this._validStatusCode = value; } + + /// + /// Creates an new instance. + /// + public ConnectivityCheckRequestProtocolConfigurationHttpConfiguration() + { + + } + } + /// Configuration for HTTP or HTTPS requests. + public partial interface IConnectivityCheckRequestProtocolConfigurationHttpConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// List of headers to be included in the request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of headers to be included in the request.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader[] Header { get; set; } + /// The HTTP method to be used. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTP method to be used.", + SerializedName = @"method", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method? Method { get; set; } + /// List of HTTP status codes considered valid for the request response. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of HTTP status codes considered valid for the request response.", + SerializedName = @"validStatusCodes", + PossibleTypes = new [] { typeof(long) })] + long[] ValidStatusCode { get; set; } + + } + /// Configuration for HTTP or HTTPS requests. + internal partial interface IConnectivityCheckRequestProtocolConfigurationHttpConfigurationInternal + + { + /// List of headers to be included in the request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader[] Header { get; set; } + /// The HTTP method to be used. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method? Method { get; set; } + /// List of HTTP status codes considered valid for the request response. + long[] ValidStatusCode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.json.cs new file mode 100644 index 000000000000..0c6a7013ddf7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestProtocolConfigurationHttpConfiguration.json.cs @@ -0,0 +1,131 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Configuration for HTTP or HTTPS requests. + public partial class ConnectivityCheckRequestProtocolConfigurationHttpConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectivityCheckRequestProtocolConfigurationHttpConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_method = If( json?.PropertyT("method"), out var __jsonMethod) ? (string)__jsonMethod : (string)Method;} + {_validStatusCode = If( json?.PropertyT("validStatusCodes"), out var __jsonValidStatusCodes) ? If( __jsonValidStatusCodes as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(long) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber __t ? (long)__t : default(long))) ))() : null : ValidStatusCode;} + {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? If( __jsonHeaders as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.HttpHeader.FromJson(__p) )) ))() : null : Header;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestProtocolConfigurationHttpConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ConnectivityCheckRequestProtocolConfigurationHttpConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._method)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._method.ToString()) : null, "method" ,container.Add ); + if (null != this._validStatusCode) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._validStatusCode ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber(__x) ,__w.Add); + } + container.Add("validStatusCodes",__w); + } + if (null != this._header) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._header ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("headers",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestSource.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestSource.cs new file mode 100644 index 000000000000..14e463171079 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestSource.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Definitions about the connectivity check origin. + public partial class ConnectivityCheckRequestSource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSource, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSourceInternal + { + + /// Backing field for property. + private long? _instance; + + /// The particular VMSS instance from which to fire the request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Instance { get => this._instance; set => this._instance = value; } + + /// Backing field for property. + private string _region; + + /// + /// The API Management service region from where to start the connectivity check operation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Region { get => this._region; set => this._region = value; } + + /// Creates an new instance. + public ConnectivityCheckRequestSource() + { + + } + } + /// Definitions about the connectivity check origin. + public partial interface IConnectivityCheckRequestSource : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The particular VMSS instance from which to fire the request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The particular VMSS instance from which to fire the request.", + SerializedName = @"instance", + PossibleTypes = new [] { typeof(long) })] + long? Instance { get; set; } + /// + /// The API Management service region from where to start the connectivity check operation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The API Management service region from where to start the connectivity check operation.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string Region { get; set; } + + } + /// Definitions about the connectivity check origin. + internal partial interface IConnectivityCheckRequestSourceInternal + + { + /// The particular VMSS instance from which to fire the request. + long? Instance { get; set; } + /// + /// The API Management service region from where to start the connectivity check operation. + /// + string Region { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestSource.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestSource.json.cs new file mode 100644 index 000000000000..e15006a0d078 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckRequestSource.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Definitions about the connectivity check origin. + public partial class ConnectivityCheckRequestSource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectivityCheckRequestSource(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_region = If( json?.PropertyT("region"), out var __jsonRegion) ? (string)__jsonRegion : (string)Region;} + {_instance = If( json?.PropertyT("instance"), out var __jsonInstance) ? (long?)__jsonInstance : Instance;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckRequestSource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ConnectivityCheckRequestSource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._region)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._region.ToString()) : null, "region" ,container.Add ); + AddIf( null != this._instance ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._instance) : null, "instance" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckResponse.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckResponse.cs new file mode 100644 index 000000000000..3d47242e4d4a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckResponse.cs @@ -0,0 +1,174 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Information on the connectivity status. + public partial class ConnectivityCheckResponse : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponse, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponseInternal + { + + /// Backing field for property. + private long? _avgLatencyInMS; + + /// Average latency in milliseconds. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? AvgLatencyInMS { get => this._avgLatencyInMS; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus? _connectionStatus; + + /// The connection status. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus? ConnectionStatus { get => this._connectionStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop[] _hop; + + /// List of hops between the source and the destination. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop[] Hop { get => this._hop; } + + /// Backing field for property. + private long? _maxLatencyInMS; + + /// Maximum latency in milliseconds. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? MaxLatencyInMS { get => this._maxLatencyInMS; } + + /// Internal Acessors for AvgLatencyInMS + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponseInternal.AvgLatencyInMS { get => this._avgLatencyInMS; set { {_avgLatencyInMS = value;} } } + + /// Internal Acessors for ConnectionStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponseInternal.ConnectionStatus { get => this._connectionStatus; set { {_connectionStatus = value;} } } + + /// Internal Acessors for Hop + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponseInternal.Hop { get => this._hop; set { {_hop = value;} } } + + /// Internal Acessors for MaxLatencyInMS + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponseInternal.MaxLatencyInMS { get => this._maxLatencyInMS; set { {_maxLatencyInMS = value;} } } + + /// Internal Acessors for MinLatencyInMS + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponseInternal.MinLatencyInMS { get => this._minLatencyInMS; set { {_minLatencyInMS = value;} } } + + /// Internal Acessors for ProbesFailed + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponseInternal.ProbesFailed { get => this._probesFailed; set { {_probesFailed = value;} } } + + /// Internal Acessors for ProbesSent + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponseInternal.ProbesSent { get => this._probesSent; set { {_probesSent = value;} } } + + /// Backing field for property. + private long? _minLatencyInMS; + + /// Minimum latency in milliseconds. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? MinLatencyInMS { get => this._minLatencyInMS; } + + /// Backing field for property. + private long? _probesFailed; + + /// Number of failed probes. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? ProbesFailed { get => this._probesFailed; } + + /// Backing field for property. + private long? _probesSent; + + /// Total number of probes sent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? ProbesSent { get => this._probesSent; } + + /// Creates an new instance. + public ConnectivityCheckResponse() + { + + } + } + /// Information on the connectivity status. + public partial interface IConnectivityCheckResponse : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Average latency in milliseconds. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Average latency in milliseconds.", + SerializedName = @"avgLatencyInMs", + PossibleTypes = new [] { typeof(long) })] + long? AvgLatencyInMS { get; } + /// The connection status. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The connection status.", + SerializedName = @"connectionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus? ConnectionStatus { get; } + /// List of hops between the source and the destination. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of hops between the source and the destination.", + SerializedName = @"hops", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop[] Hop { get; } + /// Maximum latency in milliseconds. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Maximum latency in milliseconds.", + SerializedName = @"maxLatencyInMs", + PossibleTypes = new [] { typeof(long) })] + long? MaxLatencyInMS { get; } + /// Minimum latency in milliseconds. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Minimum latency in milliseconds.", + SerializedName = @"minLatencyInMs", + PossibleTypes = new [] { typeof(long) })] + long? MinLatencyInMS { get; } + /// Number of failed probes. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of failed probes.", + SerializedName = @"probesFailed", + PossibleTypes = new [] { typeof(long) })] + long? ProbesFailed { get; } + /// Total number of probes sent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of probes sent.", + SerializedName = @"probesSent", + PossibleTypes = new [] { typeof(long) })] + long? ProbesSent { get; } + + } + /// Information on the connectivity status. + internal partial interface IConnectivityCheckResponseInternal + + { + /// Average latency in milliseconds. + long? AvgLatencyInMS { get; set; } + /// The connection status. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus? ConnectionStatus { get; set; } + /// List of hops between the source and the destination. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop[] Hop { get; set; } + /// Maximum latency in milliseconds. + long? MaxLatencyInMS { get; set; } + /// Minimum latency in milliseconds. + long? MinLatencyInMS { get; set; } + /// Number of failed probes. + long? ProbesFailed { get; set; } + /// Total number of probes sent. + long? ProbesSent { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckResponse.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckResponse.json.cs new file mode 100644 index 000000000000..7123b8283365 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityCheckResponse.json.cs @@ -0,0 +1,149 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Information on the connectivity status. + public partial class ConnectivityCheckResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectivityCheckResponse(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_hop = If( json?.PropertyT("hops"), out var __jsonHops) ? If( __jsonHops as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityHop.FromJson(__u) )) ))() : null : Hop;} + {_connectionStatus = If( json?.PropertyT("connectionStatus"), out var __jsonConnectionStatus) ? (string)__jsonConnectionStatus : (string)ConnectionStatus;} + {_avgLatencyInMS = If( json?.PropertyT("avgLatencyInMs"), out var __jsonAvgLatencyInMS) ? (long?)__jsonAvgLatencyInMS : AvgLatencyInMS;} + {_minLatencyInMS = If( json?.PropertyT("minLatencyInMs"), out var __jsonMinLatencyInMS) ? (long?)__jsonMinLatencyInMS : MinLatencyInMS;} + {_maxLatencyInMS = If( json?.PropertyT("maxLatencyInMs"), out var __jsonMaxLatencyInMS) ? (long?)__jsonMaxLatencyInMS : MaxLatencyInMS;} + {_probesSent = If( json?.PropertyT("probesSent"), out var __jsonProbesSent) ? (long?)__jsonProbesSent : ProbesSent;} + {_probesFailed = If( json?.PropertyT("probesFailed"), out var __jsonProbesFailed) ? (long?)__jsonProbesFailed : ProbesFailed;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityCheckResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ConnectivityCheckResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._hop) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._hop ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("hops",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._connectionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._connectionStatus.ToString()) : null, "connectionStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._avgLatencyInMS ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._avgLatencyInMS) : null, "avgLatencyInMs" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._minLatencyInMS ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._minLatencyInMS) : null, "minLatencyInMs" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._maxLatencyInMS ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._maxLatencyInMS) : null, "maxLatencyInMs" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._probesSent ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._probesSent) : null, "probesSent" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._probesFailed ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._probesFailed) : null, "probesFailed" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityHop.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityHop.cs new file mode 100644 index 000000000000..b343327c1455 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityHop.cs @@ -0,0 +1,154 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Information about a hop between the source and the destination. + public partial class ConnectivityHop : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHopInternal + { + + /// Backing field for property. + private string _address; + + /// The IP address of the hop. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Address { get => this._address; } + + /// Backing field for property. + private string _id; + + /// The ID of the hop. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue[] _issue; + + /// List of issues. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue[] Issue { get => this._issue; } + + /// Internal Acessors for Address + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHopInternal.Address { get => this._address; set { {_address = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHopInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Issue + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHopInternal.Issue { get => this._issue; set { {_issue = value;} } } + + /// Internal Acessors for NextHopId + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHopInternal.NextHopId { get => this._nextHopId; set { {_nextHopId = value;} } } + + /// Internal Acessors for ResourceId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHopInternal.ResourceId { get => this._resourceId; set { {_resourceId = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHopInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string[] _nextHopId; + + /// List of next hop identifiers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] NextHopId { get => this._nextHopId; } + + /// Backing field for property. + private string _resourceId; + + /// The ID of the resource corresponding to this hop. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; } + + /// Backing field for property. + private string _type; + + /// The type of the hop. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ConnectivityHop() + { + + } + } + /// Information about a hop between the source and the destination. + public partial interface IConnectivityHop : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The IP address of the hop. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IP address of the hop.", + SerializedName = @"address", + PossibleTypes = new [] { typeof(string) })] + string Address { get; } + /// The ID of the hop. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID of the hop.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// List of issues. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of issues.", + SerializedName = @"issues", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue[] Issue { get; } + /// List of next hop identifiers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of next hop identifiers.", + SerializedName = @"nextHopIds", + PossibleTypes = new [] { typeof(string) })] + string[] NextHopId { get; } + /// The ID of the resource corresponding to this hop. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID of the resource corresponding to this hop.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; } + /// The type of the hop. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the hop.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// Information about a hop between the source and the destination. + internal partial interface IConnectivityHopInternal + + { + /// The IP address of the hop. + string Address { get; set; } + /// The ID of the hop. + string Id { get; set; } + /// List of issues. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue[] Issue { get; set; } + /// List of next hop identifiers. + string[] NextHopId { get; set; } + /// The ID of the resource corresponding to this hop. + string ResourceId { get; set; } + /// The type of the hop. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityHop.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityHop.json.cs new file mode 100644 index 000000000000..2cafba722659 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityHop.json.cs @@ -0,0 +1,152 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Information about a hop between the source and the destination. + public partial class ConnectivityHop + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectivityHop(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_address = If( json?.PropertyT("address"), out var __jsonAddress) ? (string)__jsonAddress : (string)Address;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_nextHopId = If( json?.PropertyT("nextHopIds"), out var __jsonNextHopIds) ? If( __jsonNextHopIds as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : NextHopId;} + {_issue = If( json?.PropertyT("issues"), out var __jsonIssues) ? If( __jsonIssues as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityIssue.FromJson(__p) )) ))() : null : Issue;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityHop FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ConnectivityHop(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._address)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._address.ToString()) : null, "address" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._nextHopId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._nextHopId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("nextHopIds",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._issue) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._issue ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("issues",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityIssue.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityIssue.cs new file mode 100644 index 000000000000..d5ffb8ac21e4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityIssue.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Information about an issue encountered in the process of checking for connectivity. + /// + public partial class ConnectivityIssue : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssueInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext[] _context; + + /// Provides additional context on the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext[] Context { get => this._context; } + + /// Internal Acessors for Context + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssueInternal.Context { get => this._context; set { {_context = value;} } } + + /// Internal Acessors for Origin + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssueInternal.Origin { get => this._origin; set { {_origin = value;} } } + + /// Internal Acessors for Severity + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssueInternal.Severity { get => this._severity; set { {_severity = value;} } } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssueInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin? _origin; + + /// The origin of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin? Origin { get => this._origin; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity? _severity; + + /// The severity of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity? Severity { get => this._severity; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType? _type; + + /// The type of issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType? Type { get => this._type; } + + /// Creates an new instance. + public ConnectivityIssue() + { + + } + } + /// Information about an issue encountered in the process of checking for connectivity. + public partial interface IConnectivityIssue : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Provides additional context on the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Provides additional context on the issue.", + SerializedName = @"context", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext[] Context { get; } + /// The origin of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The origin of the issue.", + SerializedName = @"origin", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin? Origin { get; } + /// The severity of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The severity of the issue.", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity? Severity { get; } + /// The type of issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of issue.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType? Type { get; } + + } + /// Information about an issue encountered in the process of checking for connectivity. + internal partial interface IConnectivityIssueInternal + + { + /// Provides additional context on the issue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext[] Context { get; set; } + /// The origin of the issue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin? Origin { get; set; } + /// The severity of the issue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity? Severity { get; set; } + /// The type of issue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityIssue.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityIssue.json.cs new file mode 100644 index 000000000000..77db5b7585cc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityIssue.json.cs @@ -0,0 +1,136 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Information about an issue encountered in the process of checking for connectivity. + /// + public partial class ConnectivityIssue + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectivityIssue(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} + {_severity = If( json?.PropertyT("severity"), out var __jsonSeverity) ? (string)__jsonSeverity : (string)Severity;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_context = If( json?.PropertyT("context"), out var __jsonContext) ? If( __jsonContext as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContext.FromJson(__u) )) ))() : null : Context;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityIssue FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ConnectivityIssue(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._severity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._severity.ToString()) : null, "severity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._context) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._context ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("context",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityStatusContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityStatusContract.cs new file mode 100644 index 000000000000..a2d7c1a17ec4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityStatusContract.cs @@ -0,0 +1,185 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Details about connectivity to a resource. + public partial class ConnectivityStatusContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContractInternal + { + + /// Backing field for property. + private string _error; + + /// Error details of the connectivity to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Error { get => this._error; set => this._error = value; } + + /// Backing field for property. + private bool _isOptional; + + /// Whether this is optional. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool IsOptional { get => this._isOptional; set => this._isOptional = value; } + + /// Backing field for property. + private global::System.DateTime _lastStatusChange; + + /// + /// The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to + /// the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime LastStatusChange { get => this._lastStatusChange; set => this._lastStatusChange = value; } + + /// Backing field for property. + private global::System.DateTime _lastUpdated; + + /// + /// The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this + /// status has not been updated, then it means that the service has lost network connectivity to the resource, from inside + /// the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime LastUpdated { get => this._lastUpdated; set => this._lastUpdated = value; } + + /// Backing field for property. + private string _name; + + /// + /// The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource + /// on which the service depends upon. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _resourceType; + + /// Resource Type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceType { get => this._resourceType; set => this._resourceType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType _status; + + /// Resource Connectivity Status Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public ConnectivityStatusContract() + { + + } + } + /// Details about connectivity to a resource. + public partial interface IConnectivityStatusContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Error details of the connectivity to the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error details of the connectivity to the resource.", + SerializedName = @"error", + PossibleTypes = new [] { typeof(string) })] + string Error { get; set; } + /// Whether this is optional. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether this is optional.", + SerializedName = @"isOptional", + PossibleTypes = new [] { typeof(bool) })] + bool IsOptional { get; set; } + /// + /// The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to + /// the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"lastStatusChange", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime LastStatusChange { get; set; } + /// + /// The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this + /// status has not been updated, then it means that the service has lost network connectivity to the resource, from inside + /// the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"lastUpdated", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime LastUpdated { get; set; } + /// + /// The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource + /// on which the service depends upon. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource on which the service depends upon.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Resource Type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource Type.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; set; } + /// Resource Connectivity Status Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource Connectivity Status Type identifier.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType Status { get; set; } + + } + /// Details about connectivity to a resource. + internal partial interface IConnectivityStatusContractInternal + + { + /// Error details of the connectivity to the resource. + string Error { get; set; } + /// Whether this is optional. + bool IsOptional { get; set; } + /// + /// The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to + /// the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + global::System.DateTime LastStatusChange { get; set; } + /// + /// The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this + /// status has not been updated, then it means that the service has lost network connectivity to the resource, from inside + /// the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + global::System.DateTime LastUpdated { get; set; } + /// + /// The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource + /// on which the service depends upon. + /// + string Name { get; set; } + /// Resource Type. + string ResourceType { get; set; } + /// Resource Connectivity Status Type identifier. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityStatusContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityStatusContract.json.cs new file mode 100644 index 000000000000..d4d996eb47bc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ConnectivityStatusContract.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Details about connectivity to a resource. + public partial class ConnectivityStatusContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ConnectivityStatusContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? (string)__jsonError : (string)Error;} + {_lastUpdated = If( json?.PropertyT("lastUpdated"), out var __jsonLastUpdated) ? global::System.DateTime.TryParse((string)__jsonLastUpdated, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastUpdatedValue) ? __jsonLastUpdatedValue : LastUpdated : LastUpdated;} + {_lastStatusChange = If( json?.PropertyT("lastStatusChange"), out var __jsonLastStatusChange) ? global::System.DateTime.TryParse((string)__jsonLastStatusChange, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastStatusChangeValue) ? __jsonLastStatusChangeValue : LastStatusChange : LastStatusChange;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + {_isOptional = If( json?.PropertyT("isOptional"), out var __jsonIsOptional) ? (bool)__jsonIsOptional : IsOptional;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ConnectivityStatusContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._error)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._error.ToString()) : null, "error" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._lastUpdated.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "lastUpdated" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._lastStatusChange.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "lastStatusChange" ,container.Add ); + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean(this._isOptional), "isOptional" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemCollection.cs new file mode 100644 index 000000000000..6dcd3c1aa084 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemCollection.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged list of content items. + public partial class ContentItemCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link, if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract[] _value; + + /// Collection of content items. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract[] Value { get => this._value; } + + /// Creates an new instance. + public ContentItemCollection() + { + + } + } + /// Paged list of content items. + public partial interface IContentItemCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link, if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link, if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Collection of content items. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Collection of content items.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract[] Value { get; } + + } + /// Paged list of content items. + internal partial interface IContentItemCollectionInternal + + { + /// Next page link, if any. + string NextLink { get; set; } + /// Collection of content items. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemCollection.json.cs new file mode 100644 index 000000000000..43aced1c36f1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemCollection.json.cs @@ -0,0 +1,124 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged list of content items. + public partial class ContentItemCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ContentItemCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentItemContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ContentItemCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContract.cs new file mode 100644 index 000000000000..1b0bd8e6d605 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContract.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Content type contract details. + public partial class ContentItemContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractProperties _property; + + /// Properties of the content item. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentItemContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ContentItemContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Content type contract details. + public partial interface IContentItemContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Properties of the content item. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Properties of the content item.", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractProperties Property { get; set; } + + } + /// Content type contract details. + internal partial interface IContentItemContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Properties of the content item. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContract.json.cs new file mode 100644 index 000000000000..49511ae626a8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Content type contract details. + public partial class ContentItemContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ContentItemContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentItemContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ContentItemContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContractProperties.cs new file mode 100644 index 000000000000..61b3f3b030a8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContractProperties.cs @@ -0,0 +1,35 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Dictionary of + public partial class ContentItemContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractPropertiesInternal + { + + /// Creates an new instance. + public ContentItemContractProperties() + { + + } + } + /// Dictionary of + public partial interface IContentItemContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// Dictionary of + internal partial interface IContentItemContractPropertiesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContractProperties.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContractProperties.dictionary.cs new file mode 100644 index 000000000000..eb6a70ed2303 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContractProperties.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ContentItemContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public global::System.Object this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, global::System.Object value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out global::System.Object value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentItemContractProperties source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContractProperties.json.cs new file mode 100644 index 000000000000..855278d66439 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentItemContractProperties.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Dictionary of + public partial class ContentItemContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ContentItemContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentItemContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ContentItemContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeCollection.cs new file mode 100644 index 000000000000..d9e469967d7c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeCollection.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged list of content types. + public partial class ContentTypeCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link, if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract[] _value; + + /// Collection of content types. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract[] Value { get => this._value; } + + /// Creates an new instance. + public ContentTypeCollection() + { + + } + } + /// Paged list of content types. + public partial interface IContentTypeCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link, if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link, if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Collection of content types. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Collection of content types.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract[] Value { get; } + + } + /// Paged list of content types. + internal partial interface IContentTypeCollectionInternal + + { + /// Next page link, if any. + string NextLink { get; set; } + /// Collection of content types. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeCollection.json.cs new file mode 100644 index 000000000000..bdcdae4a647c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeCollection.json.cs @@ -0,0 +1,124 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged list of content types. + public partial class ContentTypeCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ContentTypeCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentTypeContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ContentTypeCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContract.cs new file mode 100644 index 000000000000..300e9b82b7ab --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContract.cs @@ -0,0 +1,185 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Content type contract details. + public partial class ContentTypeContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Content type description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal)Property).Description = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentTypeContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Content type identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PropertiesId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal)Property).Id = value ?? null; } + + /// Content type name. Must be 1 to 250 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal)Property).Name = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractProperties _property; + + /// Properties of the content type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentTypeContractProperties()); set => this._property = value; } + + /// Content type schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Schema { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal)Property).Schema; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal)Property).Schema = value ?? null /* model class */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Content type version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal)Property).Version = value ?? null; } + + /// Creates an new instance. + public ContentTypeContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Content type contract details. + public partial interface IContentTypeContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Content type description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Content type identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PropertiesId { get; set; } + /// Content type name. Must be 1 to 250 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type name. Must be 1 to 250 characters long.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string PropertiesName { get; set; } + /// Content type schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type schema.", + SerializedName = @"schema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Schema { get; set; } + /// Content type version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type version.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + /// Content type contract details. + internal partial interface IContentTypeContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Content type description. + string Description { get; set; } + + string ETag { get; set; } + /// Content type identifier + string PropertiesId { get; set; } + /// Content type name. Must be 1 to 250 characters long. + string PropertiesName { get; set; } + /// Properties of the content type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractProperties Property { get; set; } + /// Content type schema. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Schema { get; set; } + /// Content type version. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContract.json.cs new file mode 100644 index 000000000000..cad102717b52 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Content type contract details. + public partial class ContentTypeContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ContentTypeContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ContentTypeContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ContentTypeContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContractProperties.cs new file mode 100644 index 000000000000..25aaed011dcd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContractProperties.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ContentTypeContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Content type description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _id; + + /// Content type identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _name; + + /// Content type name. Must be 1 to 250 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny _schema; + + /// Content type schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Schema { get => (this._schema = this._schema ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any()); set => this._schema = value; } + + /// Backing field for property. + private string _version; + + /// Content type version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Version { get => this._version; set => this._version = value; } + + /// Creates an new instance. + public ContentTypeContractProperties() + { + + } + } + public partial interface IContentTypeContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Content type description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Content type identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Content type name. Must be 1 to 250 characters long. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type name. Must be 1 to 250 characters long.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Content type schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type schema.", + SerializedName = @"schema", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Schema { get; set; } + /// Content type version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type version.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + internal partial interface IContentTypeContractPropertiesInternal + + { + /// Content type description. + string Description { get; set; } + /// Content type identifier + string Id { get; set; } + /// Content type name. Must be 1 to 250 characters long. + string Name { get; set; } + /// Content type schema. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Schema { get; set; } + /// Content type version. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContractProperties.json.cs new file mode 100644 index 000000000000..17881581d341 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ContentTypeContractProperties.json.cs @@ -0,0 +1,115 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ContentTypeContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ContentTypeContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_schema = If( json?.PropertyT("schema"), out var __jsonSchema) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any.FromJson(__jsonSchema) : Schema;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IContentTypeContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ContentTypeContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != this._schema ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._schema.ToJson(null,serializationMode) : null, "schema" ,container.Add ); + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMasking.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMasking.cs new file mode 100644 index 000000000000..18ed9a54d90f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMasking.cs @@ -0,0 +1,65 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DataMasking : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] _header; + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] Header { get => this._header; set => this._header = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] _queryParam; + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] QueryParam { get => this._queryParam; set => this._queryParam = value; } + + /// Creates an new instance. + public DataMasking() + { + + } + } + public partial interface IDataMasking : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] Header { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] QueryParam { get; set; } + + } + internal partial interface IDataMaskingInternal + + { + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] Header { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] QueryParam { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMasking.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMasking.json.cs new file mode 100644 index 000000000000..2d580e6c98e6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMasking.json.cs @@ -0,0 +1,125 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DataMasking + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DataMasking(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_queryParam = If( json?.PropertyT("queryParams"), out var __jsonQueryParams) ? If( __jsonQueryParams as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DataMaskingEntity.FromJson(__u) )) ))() : null : QueryParam;} + {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? If( __jsonHeaders as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DataMaskingEntity.FromJson(__p) )) ))() : null : Header;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DataMasking(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._queryParam) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._queryParam ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("queryParams",__w); + } + if (null != this._header) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._header ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("headers",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMaskingEntity.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMaskingEntity.cs new file mode 100644 index 000000000000..ea741de8b59e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMaskingEntity.cs @@ -0,0 +1,65 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DataMaskingEntity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntityInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode? _mode; + + /// Data masking mode. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode? Mode { get => this._mode; set => this._mode = value; } + + /// Backing field for property. + private string _value; + + /// The name of an entity to mask (e.g. a name of a header or a query parameter). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public DataMaskingEntity() + { + + } + } + public partial interface IDataMaskingEntity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Data masking mode. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data masking mode.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode? Mode { get; set; } + /// The name of an entity to mask (e.g. a name of a header or a query parameter). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of an entity to mask (e.g. a name of a header or a query parameter).", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + internal partial interface IDataMaskingEntityInternal + + { + /// Data masking mode. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode? Mode { get; set; } + /// The name of an entity to mask (e.g. a name of a header or a query parameter). + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMaskingEntity.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMaskingEntity.json.cs new file mode 100644 index 000000000000..e1a74d0d4a27 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DataMaskingEntity.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DataMaskingEntity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DataMaskingEntity(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DataMaskingEntity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContract.cs new file mode 100644 index 000000000000..13d761a6e915 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContract.cs @@ -0,0 +1,179 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Deleted API Management Service information. + public partial class DeletedServiceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? DeletionDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractPropertiesInternal)Property).DeletionDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractPropertiesInternal)Property).DeletionDate = value ?? default(global::System.DateTime); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + /// API Management Service Master Location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DeletedServiceContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractProperties _property; + + /// Deleted API Management Service details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DeletedServiceContractProperties()); set => this._property = value; } + + /// + /// UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? ScheduledPurgeDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractPropertiesInternal)Property).ScheduledPurgeDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractPropertiesInternal)Property).ScheduledPurgeDate = value ?? default(global::System.DateTime); } + + /// Fully-qualified API Management Service Resource ID + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ServiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractPropertiesInternal)Property).ServiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractPropertiesInternal)Property).ServiceId = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public DeletedServiceContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Deleted API Management Service information. + public partial interface IDeletedServiceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.", + SerializedName = @"deletionDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeletionDate { get; set; } + /// API Management Service Master Location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"API Management Service Master Location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; } + /// + /// UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.", + SerializedName = @"scheduledPurgeDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ScheduledPurgeDate { get; set; } + /// Fully-qualified API Management Service Resource ID + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully-qualified API Management Service Resource ID", + SerializedName = @"serviceId", + PossibleTypes = new [] { typeof(string) })] + string ServiceId { get; set; } + + } + /// Deleted API Management Service information. + internal partial interface IDeletedServiceContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? DeletionDate { get; set; } + /// API Management Service Master Location. + string Location { get; set; } + /// Deleted API Management Service details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractProperties Property { get; set; } + /// + /// UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ + /// as specified by the ISO 8601 standard. + /// + global::System.DateTime? ScheduledPurgeDate { get; set; } + /// Fully-qualified API Management Service Resource ID + string ServiceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContract.json.cs new file mode 100644 index 000000000000..165d2c7861ec --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContract.json.cs @@ -0,0 +1,115 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Deleted API Management Service information. + public partial class DeletedServiceContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DeletedServiceContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DeletedServiceContractProperties.FromJson(__jsonProperties) : Property;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DeletedServiceContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContractProperties.cs new file mode 100644 index 000000000000..98df7fee0cc5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContractProperties.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DeletedServiceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _deletionDate; + + /// + /// UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? DeletionDate { get => this._deletionDate; set => this._deletionDate = value; } + + /// Backing field for property. + private global::System.DateTime? _scheduledPurgeDate; + + /// + /// UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? ScheduledPurgeDate { get => this._scheduledPurgeDate; set => this._scheduledPurgeDate = value; } + + /// Backing field for property. + private string _serviceId; + + /// Fully-qualified API Management Service Resource ID + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ServiceId { get => this._serviceId; set => this._serviceId = value; } + + /// Creates an new instance. + public DeletedServiceContractProperties() + { + + } + } + public partial interface IDeletedServiceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.", + SerializedName = @"deletionDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeletionDate { get; set; } + /// + /// UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.", + SerializedName = @"scheduledPurgeDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ScheduledPurgeDate { get; set; } + /// Fully-qualified API Management Service Resource ID + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully-qualified API Management Service Resource ID", + SerializedName = @"serviceId", + PossibleTypes = new [] { typeof(string) })] + string ServiceId { get; set; } + + } + internal partial interface IDeletedServiceContractPropertiesInternal + + { + /// + /// UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? DeletionDate { get; set; } + /// + /// UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ + /// as specified by the ISO 8601 standard. + /// + global::System.DateTime? ScheduledPurgeDate { get; set; } + /// Fully-qualified API Management Service Resource ID + string ServiceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContractProperties.json.cs new file mode 100644 index 000000000000..eb979da20bc8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServiceContractProperties.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DeletedServiceContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DeletedServiceContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serviceId = If( json?.PropertyT("serviceId"), out var __jsonServiceId) ? (string)__jsonServiceId : (string)ServiceId;} + {_scheduledPurgeDate = If( json?.PropertyT("scheduledPurgeDate"), out var __jsonScheduledPurgeDate) ? global::System.DateTime.TryParse((string)__jsonScheduledPurgeDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonScheduledPurgeDateValue) ? __jsonScheduledPurgeDateValue : ScheduledPurgeDate : ScheduledPurgeDate;} + {_deletionDate = If( json?.PropertyT("deletionDate"), out var __jsonDeletionDate) ? global::System.DateTime.TryParse((string)__jsonDeletionDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDeletionDateValue) ? __jsonDeletionDateValue : DeletionDate : DeletionDate;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DeletedServiceContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._serviceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._serviceId.ToString()) : null, "serviceId" ,container.Add ); + AddIf( null != this._scheduledPurgeDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._scheduledPurgeDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "scheduledPurgeDate" ,container.Add ); + AddIf( null != this._deletionDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._deletionDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "deletionDate" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServicesCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServicesCollection.cs new file mode 100644 index 000000000000..892cf7f0ae36 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServicesCollection.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged deleted API Management Services List Representation. + public partial class DeletedServicesCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServicesCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServicesCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServicesCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServicesCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract[] Value { get => this._value; } + + /// Creates an new instance. + public DeletedServicesCollection() + { + + } + } + /// Paged deleted API Management Services List Representation. + public partial interface IDeletedServicesCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract[] Value { get; } + + } + /// Paged deleted API Management Services List Representation. + internal partial interface IDeletedServicesCollectionInternal + + { + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServicesCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServicesCollection.json.cs new file mode 100644 index 000000000000..1a2c2455beb2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeletedServicesCollection.json.cs @@ -0,0 +1,124 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged deleted API Management Services List Representation. + public partial class DeletedServicesCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DeletedServicesCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServiceContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DeletedServiceContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServicesCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServicesCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeletedServicesCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DeletedServicesCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameterProperties.cs new file mode 100644 index 000000000000..bfb853667bac --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameterProperties.cs @@ -0,0 +1,80 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Deploy Configuration operation. + public partial class DeployConfigurationParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterPropertiesInternal + { + + /// Backing field for property. + private string _branch; + + /// + /// The name of the Git branch from which the configuration is to be deployed to the configuration database. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Branch { get => this._branch; set => this._branch = value; } + + /// Backing field for property. + private bool? _force; + + /// + /// The value enforcing deleting subscriptions to products that are deleted in this update. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Force { get => this._force; set => this._force = value; } + + /// Creates an new instance. + public DeployConfigurationParameterProperties() + { + + } + } + /// Parameters supplied to the Deploy Configuration operation. + public partial interface IDeployConfigurationParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The name of the Git branch from which the configuration is to be deployed to the configuration database. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Git branch from which the configuration is to be deployed to the configuration database.", + SerializedName = @"branch", + PossibleTypes = new [] { typeof(string) })] + string Branch { get; set; } + /// + /// The value enforcing deleting subscriptions to products that are deleted in this update. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value enforcing deleting subscriptions to products that are deleted in this update.", + SerializedName = @"force", + PossibleTypes = new [] { typeof(bool) })] + bool? Force { get; set; } + + } + /// Parameters supplied to the Deploy Configuration operation. + internal partial interface IDeployConfigurationParameterPropertiesInternal + + { + /// + /// The name of the Git branch from which the configuration is to be deployed to the configuration database. + /// + string Branch { get; set; } + /// + /// The value enforcing deleting subscriptions to products that are deleted in this update. + /// + bool? Force { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameterProperties.json.cs new file mode 100644 index 000000000000..7890a239d25d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameterProperties.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Deploy Configuration operation. + public partial class DeployConfigurationParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DeployConfigurationParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_branch = If( json?.PropertyT("branch"), out var __jsonBranch) ? (string)__jsonBranch : (string)Branch;} + {_force = If( json?.PropertyT("force"), out var __jsonForce) ? (bool?)__jsonForce : Force;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DeployConfigurationParameterProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._branch)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._branch.ToString()) : null, "branch" ,container.Add ); + AddIf( null != this._force ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._force) : null, "force" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameters.cs new file mode 100644 index 000000000000..55a6a7e5a771 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameters.cs @@ -0,0 +1,86 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Deploy Tenant Configuration Contract. + public partial class DeployConfigurationParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParametersInternal + { + + /// + /// The name of the Git branch from which the configuration is to be deployed to the configuration database. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Branch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterPropertiesInternal)Property).Branch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterPropertiesInternal)Property).Branch = value ?? null; } + + /// + /// The value enforcing deleting subscriptions to products that are deleted in this update. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Force { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterPropertiesInternal)Property).Force; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterPropertiesInternal)Property).Force = value ?? default(bool); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DeployConfigurationParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterProperties _property; + + /// Deploy Configuration Parameter contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DeployConfigurationParameterProperties()); set => this._property = value; } + + /// Creates an new instance. + public DeployConfigurationParameters() + { + + } + } + /// Deploy Tenant Configuration Contract. + public partial interface IDeployConfigurationParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The name of the Git branch from which the configuration is to be deployed to the configuration database. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Git branch from which the configuration is to be deployed to the configuration database.", + SerializedName = @"branch", + PossibleTypes = new [] { typeof(string) })] + string Branch { get; set; } + /// + /// The value enforcing deleting subscriptions to products that are deleted in this update. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value enforcing deleting subscriptions to products that are deleted in this update.", + SerializedName = @"force", + PossibleTypes = new [] { typeof(bool) })] + bool? Force { get; set; } + + } + /// Deploy Tenant Configuration Contract. + internal partial interface IDeployConfigurationParametersInternal + + { + /// + /// The name of the Git branch from which the configuration is to be deployed to the configuration database. + /// + string Branch { get; set; } + /// + /// The value enforcing deleting subscriptions to products that are deleted in this update. + /// + bool? Force { get; set; } + /// Deploy Configuration Parameter contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameterProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameters.json.cs new file mode 100644 index 000000000000..07497a68d60d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DeployConfigurationParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Deploy Tenant Configuration Contract. + public partial class DeployConfigurationParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DeployConfigurationParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DeployConfigurationParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDeployConfigurationParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DeployConfigurationParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticCollection.cs new file mode 100644 index 000000000000..fb5c4bb27a52 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Diagnostic list representation. + public partial class DiagnosticCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public DiagnosticCollection() + { + + } + } + /// Paged Diagnostic list representation. + public partial interface IDiagnosticCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract[] Value { get; set; } + + } + /// Paged Diagnostic list representation. + internal partial interface IDiagnosticCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticCollection.json.cs new file mode 100644 index 000000000000..1b86def73ac7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Diagnostic list representation. + public partial class DiagnosticCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DiagnosticCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DiagnosticCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContract.cs new file mode 100644 index 000000000000..8e26588ec481 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContract.cs @@ -0,0 +1,552 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Diagnostic details. + public partial class DiagnosticContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Specifies for what type of messages sampling settings should not apply. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog? AlwaysLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).AlwaysLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).AlwaysLog = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog)""); } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? BackendRequestBodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestBodyByte = value ?? default(int); } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestDataMaskingHeader = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestDataMaskingQueryParam = value ?? null /* arrayOf */; } + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] BackendRequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestHeader = value ?? null /* arrayOf */; } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? BackendResponseBodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseBodyByte = value ?? default(int); } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseDataMaskingHeader = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseDataMaskingQueryParam = value ?? null /* arrayOf */; } + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] BackendResponseHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseHeader = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? FrontendRequestBodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestBodyByte = value ?? default(int); } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestDataMaskingHeader = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestDataMaskingQueryParam = value ?? null /* arrayOf */; } + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] FrontendRequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestHeader = value ?? null /* arrayOf */; } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? FrontendResponseBodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseBodyByte = value ?? default(int); } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseDataMaskingHeader = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseDataMaskingQueryParam = value ?? null /* arrayOf */; } + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] FrontendResponseHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseHeader = value ?? null /* arrayOf */; } + + /// Sets correlation protocol to use for Application Insights diagnostics. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol? HttpCorrelationProtocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).HttpCorrelationProtocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).HttpCorrelationProtocol = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol)""); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Log the ClientIP. Default is false. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? LogClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).LogClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).LogClientIP = value ?? default(bool); } + + /// Resource Id of a target logger. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LoggerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).LoggerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).LoggerId = value ?? null; } + + /// + /// Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).Metric = value ?? default(bool); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Backend + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.Backend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).Backend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).Backend = value; } + + /// Internal Acessors for BackendRequest + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.BackendRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequest = value; } + + /// Internal Acessors for BackendRequestBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.BackendRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestBody = value; } + + /// Internal Acessors for BackendRequestDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.BackendRequestDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendRequestDataMasking = value; } + + /// Internal Acessors for BackendResponse + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.BackendResponse { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponse; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponse = value; } + + /// Internal Acessors for BackendResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.BackendResponseBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseBody = value; } + + /// Internal Acessors for BackendResponseDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.BackendResponseDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).BackendResponseDataMasking = value; } + + /// Internal Acessors for Frontend + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.Frontend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).Frontend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).Frontend = value; } + + /// Internal Acessors for FrontendRequest + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.FrontendRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequest = value; } + + /// Internal Acessors for FrontendRequestBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.FrontendRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestBody = value; } + + /// Internal Acessors for FrontendRequestDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.FrontendRequestDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendRequestDataMasking = value; } + + /// Internal Acessors for FrontendResponse + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.FrontendResponse { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponse; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponse = value; } + + /// Internal Acessors for FrontendResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.FrontendResponseBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseBody = value; } + + /// Internal Acessors for FrontendResponseDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.FrontendResponseDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).FrontendResponseDataMasking = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Sampling + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal.Sampling { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).Sampling; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).Sampling = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// + /// The format of the Operation Name for Application Insights telemetries. Default is Name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat? OperationNameFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).OperationNameFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).OperationNameFormat = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractProperties _property; + + /// Diagnostic entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContractProperties()); set => this._property = value; } + + /// Rate of sampling for fixed-rate sampling. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public double? SamplingPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).SamplingPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).SamplingPercentage = value ?? default(double); } + + /// Sampling type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType? SamplingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).SamplingType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).SamplingType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// The verbosity level applied to traces emitted by trace policies. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity? Verbosity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).Verbosity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal)Property).Verbosity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity)""); } + + /// Creates an new instance. + public DiagnosticContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Diagnostic details. + public partial interface IDiagnosticContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Specifies for what type of messages sampling settings should not apply. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies for what type of messages sampling settings should not apply.", + SerializedName = @"alwaysLog", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog? AlwaysLog { get; set; } + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? BackendRequestBodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] BackendRequestHeader { get; set; } + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? BackendResponseBodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] BackendResponseHeader { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? FrontendRequestBodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] FrontendRequestHeader { get; set; } + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? FrontendResponseBodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] FrontendResponseHeader { get; set; } + /// Sets correlation protocol to use for Application Insights diagnostics. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets correlation protocol to use for Application Insights diagnostics.", + SerializedName = @"httpCorrelationProtocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol? HttpCorrelationProtocol { get; set; } + /// Log the ClientIP. Default is false. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Log the ClientIP. Default is false.", + SerializedName = @"logClientIp", + PossibleTypes = new [] { typeof(bool) })] + bool? LogClientIP { get; set; } + /// Resource Id of a target logger. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id of a target logger.", + SerializedName = @"loggerId", + PossibleTypes = new [] { typeof(string) })] + string LoggerId { get; set; } + /// + /// Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings.", + SerializedName = @"metrics", + PossibleTypes = new [] { typeof(bool) })] + bool? Metric { get; set; } + /// + /// The format of the Operation Name for Application Insights telemetries. Default is Name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The format of the Operation Name for Application Insights telemetries. Default is Name.", + SerializedName = @"operationNameFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat? OperationNameFormat { get; set; } + /// Rate of sampling for fixed-rate sampling. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rate of sampling for fixed-rate sampling.", + SerializedName = @"percentage", + PossibleTypes = new [] { typeof(double) })] + double? SamplingPercentage { get; set; } + /// Sampling type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sampling type.", + SerializedName = @"samplingType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType? SamplingType { get; set; } + /// The verbosity level applied to traces emitted by trace policies. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The verbosity level applied to traces emitted by trace policies.", + SerializedName = @"verbosity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity? Verbosity { get; set; } + + } + /// Diagnostic details. + internal partial interface IDiagnosticContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Specifies for what type of messages sampling settings should not apply. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog? AlwaysLog { get; set; } + /// Diagnostic settings for incoming/outgoing HTTP messages to the Backend + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings Backend { get; set; } + /// Diagnostic settings for request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic BackendRequest { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings BackendRequestBody { get; set; } + /// Number of request body bytes to log. + int? BackendRequestBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking BackendRequestDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] BackendRequestHeader { get; set; } + /// Diagnostic settings for response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic BackendResponse { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings BackendResponseBody { get; set; } + /// Number of request body bytes to log. + int? BackendResponseBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking BackendResponseDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] BackendResponseHeader { get; set; } + + string ETag { get; set; } + /// Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings Frontend { get; set; } + /// Diagnostic settings for request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic FrontendRequest { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings FrontendRequestBody { get; set; } + /// Number of request body bytes to log. + int? FrontendRequestBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking FrontendRequestDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] FrontendRequestHeader { get; set; } + /// Diagnostic settings for response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic FrontendResponse { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings FrontendResponseBody { get; set; } + /// Number of request body bytes to log. + int? FrontendResponseBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking FrontendResponseDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] FrontendResponseHeader { get; set; } + /// Sets correlation protocol to use for Application Insights diagnostics. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol? HttpCorrelationProtocol { get; set; } + /// Log the ClientIP. Default is false. + bool? LogClientIP { get; set; } + /// Resource Id of a target logger. + string LoggerId { get; set; } + /// + /// Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings. + /// + bool? Metric { get; set; } + /// + /// The format of the Operation Name for Application Insights telemetries. Default is Name. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat? OperationNameFormat { get; set; } + /// Diagnostic entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractProperties Property { get; set; } + /// Sampling settings for Diagnostic. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettings Sampling { get; set; } + /// Rate of sampling for fixed-rate sampling. + double? SamplingPercentage { get; set; } + /// Sampling type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType? SamplingType { get; set; } + /// The verbosity level applied to traces emitted by trace policies. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity? Verbosity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContract.json.cs new file mode 100644 index 000000000000..8a5fe5dbfb80 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Diagnostic details. + public partial class DiagnosticContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DiagnosticContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DiagnosticContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DiagnosticContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContractProperties.cs new file mode 100644 index 000000000000..4ec3478793cf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContractProperties.cs @@ -0,0 +1,513 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Diagnostic Entity Properties + public partial class DiagnosticContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog? _alwaysLog; + + /// Specifies for what type of messages sampling settings should not apply. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog? AlwaysLog { get => this._alwaysLog; set => this._alwaysLog = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings _backend; + + /// Diagnostic settings for incoming/outgoing HTTP messages to the Backend + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings Backend { get => (this._backend = this._backend ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PipelineDiagnosticSettings()); set => this._backend = value; } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? BackendRequestBodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestBodyByte = value ?? default(int); } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestDataMaskingHeader = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestDataMaskingQueryParam = value ?? null /* arrayOf */; } + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] BackendRequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestHeader = value ?? null /* arrayOf */; } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? BackendResponseBodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseBodyByte = value ?? default(int); } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseDataMaskingHeader = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseDataMaskingQueryParam = value ?? null /* arrayOf */; } + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] BackendResponseHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseHeader = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings _frontend; + + /// Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings Frontend { get => (this._frontend = this._frontend ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PipelineDiagnosticSettings()); set => this._frontend = value; } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? FrontendRequestBodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestBodyByte = value ?? default(int); } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestDataMaskingHeader = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestDataMaskingQueryParam = value ?? null /* arrayOf */; } + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] FrontendRequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestHeader = value ?? null /* arrayOf */; } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? FrontendResponseBodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseBodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseBodyByte = value ?? default(int); } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseDataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseDataMaskingHeader = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseDataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseDataMaskingQueryParam = value ?? null /* arrayOf */; } + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] FrontendResponseHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseHeader = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol? _httpCorrelationProtocol; + + /// Sets correlation protocol to use for Application Insights diagnostics. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol? HttpCorrelationProtocol { get => this._httpCorrelationProtocol; set => this._httpCorrelationProtocol = value; } + + /// Backing field for property. + private bool? _logClientIP; + + /// Log the ClientIP. Default is false. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? LogClientIP { get => this._logClientIP; set => this._logClientIP = value; } + + /// Backing field for property. + private string _loggerId; + + /// Resource Id of a target logger. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string LoggerId { get => this._loggerId; set => this._loggerId = value; } + + /// Backing field for property. + private bool? _metric; + + /// + /// Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Metric { get => this._metric; set => this._metric = value; } + + /// Internal Acessors for Backend + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.Backend { get => (this._backend = this._backend ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PipelineDiagnosticSettings()); set { {_backend = value;} } } + + /// Internal Acessors for BackendRequest + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.BackendRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).Request = value; } + + /// Internal Acessors for BackendRequestBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.BackendRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestBody = value; } + + /// Internal Acessors for BackendRequestDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.BackendRequestDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).RequestDataMasking = value; } + + /// Internal Acessors for BackendResponse + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.BackendResponse { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).Response = value; } + + /// Internal Acessors for BackendResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.BackendResponseBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseBody = value; } + + /// Internal Acessors for BackendResponseDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.BackendResponseDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Backend).ResponseDataMasking = value; } + + /// Internal Acessors for Frontend + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.Frontend { get => (this._frontend = this._frontend ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PipelineDiagnosticSettings()); set { {_frontend = value;} } } + + /// Internal Acessors for FrontendRequest + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.FrontendRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).Request = value; } + + /// Internal Acessors for FrontendRequestBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.FrontendRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestBody = value; } + + /// Internal Acessors for FrontendRequestDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.FrontendRequestDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).RequestDataMasking = value; } + + /// Internal Acessors for FrontendResponse + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.FrontendResponse { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).Response = value; } + + /// Internal Acessors for FrontendResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.FrontendResponseBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseBody = value; } + + /// Internal Acessors for FrontendResponseDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.FrontendResponseDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseDataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal)Frontend).ResponseDataMasking = value; } + + /// Internal Acessors for Sampling + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractPropertiesInternal.Sampling { get => (this._sampling = this._sampling ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SamplingSettings()); set { {_sampling = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat? _operationNameFormat; + + /// + /// The format of the Operation Name for Application Insights telemetries. Default is Name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat? OperationNameFormat { get => this._operationNameFormat; set => this._operationNameFormat = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettings _sampling; + + /// Sampling settings for Diagnostic. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettings Sampling { get => (this._sampling = this._sampling ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SamplingSettings()); set => this._sampling = value; } + + /// Rate of sampling for fixed-rate sampling. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public double? SamplingPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettingsInternal)Sampling).Percentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettingsInternal)Sampling).Percentage = value ?? default(double); } + + /// Sampling type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType? SamplingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettingsInternal)Sampling).SamplingType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettingsInternal)Sampling).SamplingType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity? _verbosity; + + /// The verbosity level applied to traces emitted by trace policies. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity? Verbosity { get => this._verbosity; set => this._verbosity = value; } + + /// Creates an new instance. + public DiagnosticContractProperties() + { + + } + } + /// Diagnostic Entity Properties + public partial interface IDiagnosticContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Specifies for what type of messages sampling settings should not apply. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies for what type of messages sampling settings should not apply.", + SerializedName = @"alwaysLog", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog? AlwaysLog { get; set; } + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? BackendRequestBodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] BackendRequestHeader { get; set; } + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? BackendResponseBodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] BackendResponseHeader { get; set; } + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? FrontendRequestBodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] FrontendRequestHeader { get; set; } + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? FrontendResponseBodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] FrontendResponseHeader { get; set; } + /// Sets correlation protocol to use for Application Insights diagnostics. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets correlation protocol to use for Application Insights diagnostics.", + SerializedName = @"httpCorrelationProtocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol? HttpCorrelationProtocol { get; set; } + /// Log the ClientIP. Default is false. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Log the ClientIP. Default is false.", + SerializedName = @"logClientIp", + PossibleTypes = new [] { typeof(bool) })] + bool? LogClientIP { get; set; } + /// Resource Id of a target logger. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource Id of a target logger.", + SerializedName = @"loggerId", + PossibleTypes = new [] { typeof(string) })] + string LoggerId { get; set; } + /// + /// Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings.", + SerializedName = @"metrics", + PossibleTypes = new [] { typeof(bool) })] + bool? Metric { get; set; } + /// + /// The format of the Operation Name for Application Insights telemetries. Default is Name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The format of the Operation Name for Application Insights telemetries. Default is Name.", + SerializedName = @"operationNameFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat? OperationNameFormat { get; set; } + /// Rate of sampling for fixed-rate sampling. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rate of sampling for fixed-rate sampling.", + SerializedName = @"percentage", + PossibleTypes = new [] { typeof(double) })] + double? SamplingPercentage { get; set; } + /// Sampling type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sampling type.", + SerializedName = @"samplingType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType? SamplingType { get; set; } + /// The verbosity level applied to traces emitted by trace policies. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The verbosity level applied to traces emitted by trace policies.", + SerializedName = @"verbosity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity? Verbosity { get; set; } + + } + /// Diagnostic Entity Properties + internal partial interface IDiagnosticContractPropertiesInternal + + { + /// Specifies for what type of messages sampling settings should not apply. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog? AlwaysLog { get; set; } + /// Diagnostic settings for incoming/outgoing HTTP messages to the Backend + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings Backend { get; set; } + /// Diagnostic settings for request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic BackendRequest { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings BackendRequestBody { get; set; } + /// Number of request body bytes to log. + int? BackendRequestBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking BackendRequestDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] BackendRequestHeader { get; set; } + /// Diagnostic settings for response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic BackendResponse { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings BackendResponseBody { get; set; } + /// Number of request body bytes to log. + int? BackendResponseBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking BackendResponseDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] BackendResponseDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] BackendResponseHeader { get; set; } + /// Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings Frontend { get; set; } + /// Diagnostic settings for request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic FrontendRequest { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings FrontendRequestBody { get; set; } + /// Number of request body bytes to log. + int? FrontendRequestBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking FrontendRequestDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendRequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] FrontendRequestHeader { get; set; } + /// Diagnostic settings for response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic FrontendResponse { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings FrontendResponseBody { get; set; } + /// Number of request body bytes to log. + int? FrontendResponseBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking FrontendResponseDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] FrontendResponseDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] FrontendResponseHeader { get; set; } + /// Sets correlation protocol to use for Application Insights diagnostics. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol? HttpCorrelationProtocol { get; set; } + /// Log the ClientIP. Default is false. + bool? LogClientIP { get; set; } + /// Resource Id of a target logger. + string LoggerId { get; set; } + /// + /// Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings. + /// + bool? Metric { get; set; } + /// + /// The format of the Operation Name for Application Insights telemetries. Default is Name. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat? OperationNameFormat { get; set; } + /// Sampling settings for Diagnostic. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettings Sampling { get; set; } + /// Rate of sampling for fixed-rate sampling. + double? SamplingPercentage { get; set; } + /// Sampling type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType? SamplingType { get; set; } + /// The verbosity level applied to traces emitted by trace policies. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity? Verbosity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContractProperties.json.cs new file mode 100644 index 000000000000..5d906d5c1030 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DiagnosticContractProperties.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Diagnostic Entity Properties + public partial class DiagnosticContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DiagnosticContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sampling = If( json?.PropertyT("sampling"), out var __jsonSampling) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SamplingSettings.FromJson(__jsonSampling) : Sampling;} + {_frontend = If( json?.PropertyT("frontend"), out var __jsonFrontend) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PipelineDiagnosticSettings.FromJson(__jsonFrontend) : Frontend;} + {_backend = If( json?.PropertyT("backend"), out var __jsonBackend) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PipelineDiagnosticSettings.FromJson(__jsonBackend) : Backend;} + {_alwaysLog = If( json?.PropertyT("alwaysLog"), out var __jsonAlwaysLog) ? (string)__jsonAlwaysLog : (string)AlwaysLog;} + {_loggerId = If( json?.PropertyT("loggerId"), out var __jsonLoggerId) ? (string)__jsonLoggerId : (string)LoggerId;} + {_logClientIP = If( json?.PropertyT("logClientIp"), out var __jsonLogClientIP) ? (bool?)__jsonLogClientIP : LogClientIP;} + {_httpCorrelationProtocol = If( json?.PropertyT("httpCorrelationProtocol"), out var __jsonHttpCorrelationProtocol) ? (string)__jsonHttpCorrelationProtocol : (string)HttpCorrelationProtocol;} + {_verbosity = If( json?.PropertyT("verbosity"), out var __jsonVerbosity) ? (string)__jsonVerbosity : (string)Verbosity;} + {_operationNameFormat = If( json?.PropertyT("operationNameFormat"), out var __jsonOperationNameFormat) ? (string)__jsonOperationNameFormat : (string)OperationNameFormat;} + {_metric = If( json?.PropertyT("metrics"), out var __jsonMetrics) ? (bool?)__jsonMetrics : Metric;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDiagnosticContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DiagnosticContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sampling ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._sampling.ToJson(null,serializationMode) : null, "sampling" ,container.Add ); + AddIf( null != this._frontend ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._frontend.ToJson(null,serializationMode) : null, "frontend" ,container.Add ); + AddIf( null != this._backend ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._backend.ToJson(null,serializationMode) : null, "backend" ,container.Add ); + AddIf( null != (((object)this._alwaysLog)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._alwaysLog.ToString()) : null, "alwaysLog" ,container.Add ); + AddIf( null != (((object)this._loggerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._loggerId.ToString()) : null, "loggerId" ,container.Add ); + AddIf( null != this._logClientIP ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._logClientIP) : null, "logClientIp" ,container.Add ); + AddIf( null != (((object)this._httpCorrelationProtocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._httpCorrelationProtocol.ToString()) : null, "httpCorrelationProtocol" ,container.Add ); + AddIf( null != (((object)this._verbosity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._verbosity.ToString()) : null, "verbosity" ,container.Add ); + AddIf( null != (((object)this._operationNameFormat)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._operationNameFormat.ToString()) : null, "operationNameFormat" ,container.Add ); + AddIf( null != this._metric ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._metric) : null, "metrics" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationCollection.cs new file mode 100644 index 000000000000..a60345f402e3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationCollection.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Documentation list representation. + public partial class DocumentationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract[] Value { get => this._value; } + + /// Creates an new instance. + public DocumentationCollection() + { + + } + } + /// Paged Documentation list representation. + public partial interface IDocumentationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract[] Value { get; } + + } + /// Paged Documentation list representation. + internal partial interface IDocumentationCollectionInternal + + { + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationCollection.json.cs new file mode 100644 index 000000000000..648b17f93432 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationCollection.json.cs @@ -0,0 +1,124 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Documentation list representation. + public partial class DocumentationCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DocumentationCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DocumentationCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContract.cs new file mode 100644 index 000000000000..c4209757425a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContract.cs @@ -0,0 +1,143 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Markdown documentation details. + public partial class DocumentationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Markdown documentation content. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Content { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractPropertiesInternal)Property).Content; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractPropertiesInternal)Property).Content = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties _property; + + /// Markdown Documentation details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContractProperties()); set => this._property = value; } + + /// documentation title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractPropertiesInternal)Property).Title = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public DocumentationContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Markdown documentation details. + public partial interface IDocumentationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Markdown documentation content. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Markdown documentation content.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(string) })] + string Content { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// documentation title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"documentation title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Markdown documentation details. + internal partial interface IDocumentationContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Markdown documentation content. + string Content { get; set; } + + string ETag { get; set; } + /// Markdown Documentation details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties Property { get; set; } + /// documentation title. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContract.json.cs new file mode 100644 index 000000000000..5892bf3fe2f8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Markdown documentation details. + public partial class DocumentationContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DocumentationContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DocumentationContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContractProperties.cs new file mode 100644 index 000000000000..d92840526b7b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContractProperties.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Markdown documentation details. + public partial class DocumentationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractPropertiesInternal + { + + /// Backing field for property. + private string _content; + + /// Markdown documentation content. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Content { get => this._content; set => this._content = value; } + + /// Backing field for property. + private string _title; + + /// documentation title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// Creates an new instance. + public DocumentationContractProperties() + { + + } + } + /// Markdown documentation details. + public partial interface IDocumentationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Markdown documentation content. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Markdown documentation content.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(string) })] + string Content { get; set; } + /// documentation title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"documentation title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Markdown documentation details. + internal partial interface IDocumentationContractPropertiesInternal + + { + /// Markdown documentation content. + string Content { get; set; } + /// documentation title. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContractProperties.json.cs new file mode 100644 index 000000000000..6da641d6905f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationContractProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Markdown documentation details. + public partial class DocumentationContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DocumentationContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_content = If( json?.PropertyT("content"), out var __jsonContent) ? (string)__jsonContent : (string)Content;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DocumentationContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._content)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._content.ToString()) : null, "content" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationUpdateContract.cs new file mode 100644 index 000000000000..03f8b460fcf8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationUpdateContract.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Documentation update contract details. + public partial class DocumentationUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationUpdateContractInternal + { + + /// Markdown documentation content. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Content { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractPropertiesInternal)Property).Content; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractPropertiesInternal)Property).Content = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties _property; + + /// Markdown Documentation details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContractProperties()); set => this._property = value; } + + /// documentation title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractPropertiesInternal)Property).Title = value ?? null; } + + /// Creates an new instance. + public DocumentationUpdateContract() + { + + } + } + /// Documentation update contract details. + public partial interface IDocumentationUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Markdown documentation content. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Markdown documentation content.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(string) })] + string Content { get; set; } + /// documentation title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"documentation title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Documentation update contract details. + internal partial interface IDocumentationUpdateContractInternal + + { + /// Markdown documentation content. + string Content { get; set; } + /// Markdown Documentation details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationContractProperties Property { get; set; } + /// documentation title. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationUpdateContract.json.cs new file mode 100644 index 000000000000..7b9e22dd592e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/DocumentationUpdateContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Documentation update contract details. + public partial class DocumentationUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DocumentationUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DocumentationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDocumentationUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DocumentationUpdateContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateCollection.cs new file mode 100644 index 000000000000..da9664382e27 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged email template list representation. + public partial class EmailTemplateCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public EmailTemplateCollection() + { + + } + } + /// Paged email template list representation. + public partial interface IEmailTemplateCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContract[] Value { get; set; } + + } + /// Paged email template list representation. + internal partial interface IEmailTemplateCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateCollection.json.cs new file mode 100644 index 000000000000..75fda6261b7a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged email template list representation. + public partial class EmailTemplateCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal EmailTemplateCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new EmailTemplateCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContract.cs new file mode 100644 index 000000000000..83e5ce31c7c1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContract.cs @@ -0,0 +1,208 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template details. + public partial class EmailTemplateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Email Template Body. This should be a valid XDocument + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Body { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).Body; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).Body = value ?? null; } + + /// Description of the Email Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).Description = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// + /// Whether the template is the default template provided by API Management or has been edited. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).IsDefault; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for IsDefault + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractInternal.IsDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).IsDefault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).IsDefault = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Email Template Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractProperties _property; + + /// Email Template entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateContractProperties()); set => this._property = value; } + + /// Subject of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Subject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).Subject = value ?? null; } + + /// Title of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal)Property).Title = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public EmailTemplateContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Email Template details. + public partial interface IEmailTemplateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Email Template Body. This should be a valid XDocument + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email Template Body. This should be a valid XDocument", + SerializedName = @"body", + PossibleTypes = new [] { typeof(string) })] + string Body { get; set; } + /// Description of the Email Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the Email Template.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// Whether the template is the default template provided by API Management or has been edited. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether the template is the default template provided by API Management or has been edited.", + SerializedName = @"isDefault", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDefault { get; } + /// Email Template Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email Template Parameter values.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get; set; } + /// Subject of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subject of the Template.", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string Subject { get; set; } + /// Title of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Title of the Template.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Email Template details. + internal partial interface IEmailTemplateContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Email Template Body. This should be a valid XDocument + string Body { get; set; } + /// Description of the Email Template. + string Description { get; set; } + + string ETag { get; set; } + /// + /// Whether the template is the default template provided by API Management or has been edited. + /// + bool? IsDefault { get; set; } + /// Email Template Parameter values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get; set; } + /// Email Template entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractProperties Property { get; set; } + /// Subject of the Template. + string Subject { get; set; } + /// Title of the Template. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContract.json.cs new file mode 100644 index 000000000000..7841e122b0ea --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template details. + public partial class EmailTemplateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal EmailTemplateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new EmailTemplateContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContractProperties.cs new file mode 100644 index 000000000000..069e5e3057a4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContractProperties.cs @@ -0,0 +1,145 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template Contract properties. + public partial class EmailTemplateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal + { + + /// Backing field for property. + private string _body; + + /// Email Template Body. This should be a valid XDocument + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Body { get => this._body; set => this._body = value; } + + /// Backing field for property. + private string _description; + + /// Description of the Email Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private bool? _isDefault; + + /// + /// Whether the template is the default template provided by API Management or has been edited. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsDefault { get => this._isDefault; } + + /// Internal Acessors for IsDefault + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractPropertiesInternal.IsDefault { get => this._isDefault; set { {_isDefault = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] _parameter; + + /// Email Template Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get => this._parameter; set => this._parameter = value; } + + /// Backing field for property. + private string _subject; + + /// Subject of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Subject { get => this._subject; set => this._subject = value; } + + /// Backing field for property. + private string _title; + + /// Title of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// Creates an new instance. + public EmailTemplateContractProperties() + { + + } + } + /// Email Template Contract properties. + public partial interface IEmailTemplateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Email Template Body. This should be a valid XDocument + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Email Template Body. This should be a valid XDocument", + SerializedName = @"body", + PossibleTypes = new [] { typeof(string) })] + string Body { get; set; } + /// Description of the Email Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the Email Template.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Whether the template is the default template provided by API Management or has been edited. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether the template is the default template provided by API Management or has been edited.", + SerializedName = @"isDefault", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDefault { get; } + /// Email Template Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email Template Parameter values.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get; set; } + /// Subject of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subject of the Template.", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string Subject { get; set; } + /// Title of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Title of the Template.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Email Template Contract properties. + internal partial interface IEmailTemplateContractPropertiesInternal + + { + /// Email Template Body. This should be a valid XDocument + string Body { get; set; } + /// Description of the Email Template. + string Description { get; set; } + /// + /// Whether the template is the default template provided by API Management or has been edited. + /// + bool? IsDefault { get; set; } + /// Email Template Parameter values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get; set; } + /// Subject of the Template. + string Subject { get; set; } + /// Title of the Template. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContractProperties.json.cs new file mode 100644 index 000000000000..268702fb7539 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateContractProperties.json.cs @@ -0,0 +1,129 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template Contract properties. + public partial class EmailTemplateContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal EmailTemplateContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subject = If( json?.PropertyT("subject"), out var __jsonSubject) ? (string)__jsonSubject : (string)Subject;} + {_body = If( json?.PropertyT("body"), out var __jsonBody) ? (string)__jsonBody : (string)Body;} + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_isDefault = If( json?.PropertyT("isDefault"), out var __jsonIsDefault) ? (bool?)__jsonIsDefault : IsDefault;} + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateParametersContractProperties.FromJson(__u) )) ))() : null : Parameter;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new EmailTemplateContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._subject)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._subject.ToString()) : null, "subject" ,container.Add ); + AddIf( null != (((object)this._body)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._body.ToString()) : null, "body" ,container.Add ); + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isDefault ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isDefault) : null, "isDefault" ,container.Add ); + } + if (null != this._parameter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._parameter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("parameters",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateParametersContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateParametersContractProperties.cs new file mode 100644 index 000000000000..92442029b32b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateParametersContractProperties.cs @@ -0,0 +1,87 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template Parameter contract. + public partial class EmailTemplateParametersContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Template parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _name; + + /// Template parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _title; + + /// Template parameter title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// + /// Creates an new instance. + /// + public EmailTemplateParametersContractProperties() + { + + } + } + /// Email Template Parameter contract. + public partial interface IEmailTemplateParametersContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Template parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Template parameter description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Template parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Template parameter name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Template parameter title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Template parameter title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Email Template Parameter contract. + internal partial interface IEmailTemplateParametersContractPropertiesInternal + + { + /// Template parameter description. + string Description { get; set; } + /// Template parameter name. + string Name { get; set; } + /// Template parameter title. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateParametersContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateParametersContractProperties.json.cs new file mode 100644 index 000000000000..72b7c9f8598f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateParametersContractProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template Parameter contract. + public partial class EmailTemplateParametersContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal EmailTemplateParametersContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new EmailTemplateParametersContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameterProperties.cs new file mode 100644 index 000000000000..fa3359a13acc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameterProperties.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template Update Contract properties. + public partial class EmailTemplateUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal + { + + /// Backing field for property. + private string _body; + + /// Email Template Body. This should be a valid XDocument + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Body { get => this._body; set => this._body = value; } + + /// Backing field for property. + private string _description; + + /// Description of the Email Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] _parameter; + + /// Email Template Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get => this._parameter; set => this._parameter = value; } + + /// Backing field for property. + private string _subject; + + /// Subject of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Subject { get => this._subject; set => this._subject = value; } + + /// Backing field for property. + private string _title; + + /// Title of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// Creates an new instance. + public EmailTemplateUpdateParameterProperties() + { + + } + } + /// Email Template Update Contract properties. + public partial interface IEmailTemplateUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Email Template Body. This should be a valid XDocument + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email Template Body. This should be a valid XDocument", + SerializedName = @"body", + PossibleTypes = new [] { typeof(string) })] + string Body { get; set; } + /// Description of the Email Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the Email Template.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Email Template Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email Template Parameter values.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get; set; } + /// Subject of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subject of the Template.", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string Subject { get; set; } + /// Title of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Title of the Template.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Email Template Update Contract properties. + internal partial interface IEmailTemplateUpdateParameterPropertiesInternal + + { + /// Email Template Body. This should be a valid XDocument + string Body { get; set; } + /// Description of the Email Template. + string Description { get; set; } + /// Email Template Parameter values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get; set; } + /// Subject of the Template. + string Subject { get; set; } + /// Title of the Template. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..b4e9d12d8712 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameterProperties.json.cs @@ -0,0 +1,125 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template Update Contract properties. + public partial class EmailTemplateUpdateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal EmailTemplateUpdateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subject = If( json?.PropertyT("subject"), out var __jsonSubject) ? (string)__jsonSubject : (string)Subject;} + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_body = If( json?.PropertyT("body"), out var __jsonBody) ? (string)__jsonBody : (string)Body;} + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateParametersContractProperties.FromJson(__u) )) ))() : null : Parameter;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new EmailTemplateUpdateParameterProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._subject)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._subject.ToString()) : null, "subject" ,container.Add ); + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._body)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._body.ToString()) : null, "body" ,container.Add ); + if (null != this._parameter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._parameter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("parameters",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameters.cs new file mode 100644 index 000000000000..8bb0e4c82a0c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameters.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template update Parameters. + public partial class EmailTemplateUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParametersInternal + { + + /// Email Template Body. This should be a valid XDocument + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Body { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal)Property).Body; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal)Property).Body = value ?? null; } + + /// Description of the Email Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal)Property).Description = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateUpdateParameterProperties()); set { {_property = value;} } } + + /// Email Template Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterProperties _property; + + /// Email Template Update contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateUpdateParameterProperties()); set => this._property = value; } + + /// Subject of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Subject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal)Property).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal)Property).Subject = value ?? null; } + + /// Title of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterPropertiesInternal)Property).Title = value ?? null; } + + /// Creates an new instance. + public EmailTemplateUpdateParameters() + { + + } + } + /// Email Template update Parameters. + public partial interface IEmailTemplateUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Email Template Body. This should be a valid XDocument + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email Template Body. This should be a valid XDocument", + SerializedName = @"body", + PossibleTypes = new [] { typeof(string) })] + string Body { get; set; } + /// Description of the Email Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the Email Template.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Email Template Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email Template Parameter values.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get; set; } + /// Subject of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subject of the Template.", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string Subject { get; set; } + /// Title of the Template. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Title of the Template.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Email Template update Parameters. + internal partial interface IEmailTemplateUpdateParametersInternal + + { + /// Email Template Body. This should be a valid XDocument + string Body { get; set; } + /// Description of the Email Template. + string Description { get; set; } + /// Email Template Parameter values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateParametersContractProperties[] Parameter { get; set; } + /// Email Template Update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameterProperties Property { get; set; } + /// Subject of the Template. + string Subject { get; set; } + /// Title of the Template. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameters.json.cs new file mode 100644 index 000000000000..9303a8597cec --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EmailTemplateUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Email Template update Parameters. + public partial class EmailTemplateUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal EmailTemplateUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EmailTemplateUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEmailTemplateUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new EmailTemplateUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDependency.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDependency.cs new file mode 100644 index 000000000000..8d3ccec14e00 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDependency.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A domain name that a service is reached at. + public partial class EndpointDependency : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependency, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependencyInternal + { + + /// Backing field for property. + private string _domainName; + + /// The domain name of the dependency. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetail[] _endpointDetail; + + /// The Ports used when connecting to DomainName. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetail[] EndpointDetail { get => this._endpointDetail; set => this._endpointDetail = value; } + + /// Creates an new instance. + public EndpointDependency() + { + + } + } + /// A domain name that a service is reached at. + public partial interface IEndpointDependency : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The domain name of the dependency. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The domain name of the dependency.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string DomainName { get; set; } + /// The Ports used when connecting to DomainName. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Ports used when connecting to DomainName.", + SerializedName = @"endpointDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetail[] EndpointDetail { get; set; } + + } + /// A domain name that a service is reached at. + internal partial interface IEndpointDependencyInternal + + { + /// The domain name of the dependency. + string DomainName { get; set; } + /// The Ports used when connecting to DomainName. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetail[] EndpointDetail { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDependency.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDependency.json.cs new file mode 100644 index 000000000000..6a2131f21c48 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDependency.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A domain name that a service is reached at. + public partial class EndpointDependency + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal EndpointDependency(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_domainName = If( json?.PropertyT("domainName"), out var __jsonDomainName) ? (string)__jsonDomainName : (string)DomainName;} + {_endpointDetail = If( json?.PropertyT("endpointDetails"), out var __jsonEndpointDetails) ? If( __jsonEndpointDetails as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetail) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EndpointDetail.FromJson(__u) )) ))() : null : EndpointDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependency. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependency. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependency FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new EndpointDependency(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._domainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._domainName.ToString()) : null, "domainName" ,container.Add ); + if (null != this._endpointDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._endpointDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("endpointDetails",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDetail.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDetail.cs new file mode 100644 index 000000000000..15643668bc74 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDetail.cs @@ -0,0 +1,70 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Current TCP connectivity information from the Api Management Service to a single endpoint. + /// + public partial class EndpointDetail : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetail, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetailInternal + { + + /// Backing field for property. + private int? _port; + + /// The port an endpoint is connected to. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? Port { get => this._port; set => this._port = value; } + + /// Backing field for property. + private string _region; + + /// The region of the dependency. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Region { get => this._region; set => this._region = value; } + + /// Creates an new instance. + public EndpointDetail() + { + + } + } + /// Current TCP connectivity information from the Api Management Service to a single endpoint. + public partial interface IEndpointDetail : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The port an endpoint is connected to. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The port an endpoint is connected to.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? Port { get; set; } + /// The region of the dependency. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The region of the dependency.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string Region { get; set; } + + } + /// Current TCP connectivity information from the Api Management Service to a single endpoint. + internal partial interface IEndpointDetailInternal + + { + /// The port an endpoint is connected to. + int? Port { get; set; } + /// The region of the dependency. + string Region { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDetail.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDetail.json.cs new file mode 100644 index 000000000000..d80d2b9d485e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/EndpointDetail.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Current TCP connectivity information from the Api Management Service to a single endpoint. + /// + public partial class EndpointDetail + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal EndpointDetail(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (int?)__jsonPort : Port;} + {_region = If( json?.PropertyT("region"), out var __jsonRegion) ? (string)__jsonRegion : (string)Region;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new EndpointDetail(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._port) : null, "port" ,container.Add ); + AddIf( null != (((object)this._region)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._region.ToString()) : null, "region" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorFieldContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorFieldContract.cs new file mode 100644 index 000000000000..dd8f5fccefaf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorFieldContract.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Error Field contract. + public partial class ErrorFieldContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContractInternal + { + + /// Backing field for property. + private string _code; + + /// Property level error code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + /// Human-readable representation of property-level error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private string _target; + + /// Property name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Target { get => this._target; set => this._target = value; } + + /// Creates an new instance. + public ErrorFieldContract() + { + + } + } + /// Error Field contract. + public partial interface IErrorFieldContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Property level error code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property level error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Human-readable representation of property-level error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Human-readable representation of property-level error.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Property name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Property name.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; set; } + + } + /// Error Field contract. + internal partial interface IErrorFieldContractInternal + + { + /// Property level error code. + string Code { get; set; } + /// Human-readable representation of property-level error. + string Message { get; set; } + /// Property name. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorFieldContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorFieldContract.json.cs new file mode 100644 index 000000000000..59f7a13fb095 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorFieldContract.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Error Field contract. + public partial class ErrorFieldContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorFieldContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ErrorFieldContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponse.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponse.cs new file mode 100644 index 000000000000..ea6618216bb6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponse.cs @@ -0,0 +1,94 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Error Response. + public partial class ErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseInternal + { + + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Code = value ?? null; } + + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody _error; + + /// Properties of the Error Response. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponseBody()); set => this._error = value; } + + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponseBody()); set { {_error = value;} } } + + /// Creates an new instance. + public ErrorResponse() + { + + } + } + /// Error Response. + public partial interface IErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of invalid fields send in request, in case of validation error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Human-readable representation of the error.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// Error Response. + internal partial interface IErrorResponseInternal + + { + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Properties of the Error Response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Error { get; set; } + /// Human-readable representation of the error. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponse.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponse.json.cs new file mode 100644 index 000000000000..cedc822f5cca --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponse.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Error Response. + public partial class ErrorResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponseBody.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponseBody.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponseBody.cs new file mode 100644 index 000000000000..0893bc14dee7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponseBody.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Error Body contract. + public partial class ErrorResponseBody : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal + { + + /// Backing field for property. + private string _code; + + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] _detail; + + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get => this._detail; set => this._detail = value; } + + /// Backing field for property. + private string _message; + + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public ErrorResponseBody() + { + + } + } + /// Error Body contract. + public partial interface IErrorResponseBody : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of invalid fields send in request, in case of validation error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Human-readable representation of the error.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// Error Body contract. + internal partial interface IErrorResponseBodyInternal + + { + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Human-readable representation of the error. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponseBody.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponseBody.json.cs new file mode 100644 index 000000000000..91f5b494c00a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ErrorResponseBody.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Error Body contract. + public partial class ErrorResponseBody + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponseBody(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorFieldContract.FromJson(__u) )) ))() : null : Detail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ErrorResponseBody(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + if (null != this._detail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._detail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("details",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/FailureStatusCodeRange.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/FailureStatusCodeRange.cs new file mode 100644 index 000000000000..11878429bec3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/FailureStatusCodeRange.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The failure http status code range + public partial class FailureStatusCodeRange : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRangeInternal + { + + /// Backing field for property. + private int? _max; + + /// The maximum http status code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? Max { get => this._max; set => this._max = value; } + + /// Backing field for property. + private int? _min; + + /// The minimum http status code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? Min { get => this._min; set => this._min = value; } + + /// Creates an new instance. + public FailureStatusCodeRange() + { + + } + } + /// The failure http status code range + public partial interface IFailureStatusCodeRange : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The maximum http status code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum http status code.", + SerializedName = @"max", + PossibleTypes = new [] { typeof(int) })] + int? Max { get; set; } + /// The minimum http status code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The minimum http status code.", + SerializedName = @"min", + PossibleTypes = new [] { typeof(int) })] + int? Min { get; set; } + + } + /// The failure http status code range + internal partial interface IFailureStatusCodeRangeInternal + + { + /// The maximum http status code. + int? Max { get; set; } + /// The minimum http status code. + int? Min { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/FailureStatusCodeRange.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/FailureStatusCodeRange.json.cs new file mode 100644 index 000000000000..6fbb45c9aa92 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/FailureStatusCodeRange.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The failure http status code range + public partial class FailureStatusCodeRange + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal FailureStatusCodeRange(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_min = If( json?.PropertyT("min"), out var __jsonMin) ? (int?)__jsonMin : Min;} + {_max = If( json?.PropertyT("max"), out var __jsonMax) ? (int?)__jsonMax : Max;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IFailureStatusCodeRange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new FailureStatusCodeRange(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._min ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._min) : null, "min" ,container.Add ); + AddIf( null != this._max ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._max) : null, "max" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityCollection.cs new file mode 100644 index 000000000000..1325dcb52500 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityCollection.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Gateway certificate authority list representation. + public partial class GatewayCertificateAuthorityCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract[] Value { get => this._value; } + + /// Creates an new instance. + public GatewayCertificateAuthorityCollection() + { + + } + } + /// Paged Gateway certificate authority list representation. + public partial interface IGatewayCertificateAuthorityCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract[] Value { get; } + + } + /// Paged Gateway certificate authority list representation. + internal partial interface IGatewayCertificateAuthorityCollectionInternal + + { + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityCollection.json.cs new file mode 100644 index 000000000000..31033a1dcc74 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityCollection.json.cs @@ -0,0 +1,125 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Gateway certificate authority list representation. + public partial class GatewayCertificateAuthorityCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayCertificateAuthorityCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayCertificateAuthorityCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayCertificateAuthorityContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContract.cs new file mode 100644 index 000000000000..0713bfca39b8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContract.cs @@ -0,0 +1,127 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway certificate authority details. + public partial class GatewayCertificateAuthorityContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Determines whether certificate authority is trusted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsTrusted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractPropertiesInternal)Property).IsTrusted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractPropertiesInternal)Property).IsTrusted = value ?? default(bool); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayCertificateAuthorityContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractProperties _property; + + /// Gateway certificate authority details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayCertificateAuthorityContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public GatewayCertificateAuthorityContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Gateway certificate authority details. + public partial interface IGatewayCertificateAuthorityContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Determines whether certificate authority is trusted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether certificate authority is trusted.", + SerializedName = @"isTrusted", + PossibleTypes = new [] { typeof(bool) })] + bool? IsTrusted { get; set; } + + } + /// Gateway certificate authority details. + internal partial interface IGatewayCertificateAuthorityContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Determines whether certificate authority is trusted. + bool? IsTrusted { get; set; } + /// Gateway certificate authority details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContract.json.cs new file mode 100644 index 000000000000..49739bee7a75 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContract.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway certificate authority details. + public partial class GatewayCertificateAuthorityContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayCertificateAuthorityContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayCertificateAuthorityContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayCertificateAuthorityContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContractProperties.cs new file mode 100644 index 000000000000..24996ab61f5e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContractProperties.cs @@ -0,0 +1,53 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway certificate authority details. + public partial class GatewayCertificateAuthorityContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractPropertiesInternal + { + + /// Backing field for property. + private bool? _isTrusted; + + /// Determines whether certificate authority is trusted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsTrusted { get => this._isTrusted; set => this._isTrusted = value; } + + /// + /// Creates an new instance. + /// + public GatewayCertificateAuthorityContractProperties() + { + + } + } + /// Gateway certificate authority details. + public partial interface IGatewayCertificateAuthorityContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether certificate authority is trusted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether certificate authority is trusted.", + SerializedName = @"isTrusted", + PossibleTypes = new [] { typeof(bool) })] + bool? IsTrusted { get; set; } + + } + /// Gateway certificate authority details. + internal partial interface IGatewayCertificateAuthorityContractPropertiesInternal + + { + /// Determines whether certificate authority is trusted. + bool? IsTrusted { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContractProperties.json.cs new file mode 100644 index 000000000000..e4bd14123380 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCertificateAuthorityContractProperties.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway certificate authority details. + public partial class GatewayCertificateAuthorityContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCertificateAuthorityContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayCertificateAuthorityContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayCertificateAuthorityContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_isTrusted = If( json?.PropertyT("isTrusted"), out var __jsonIsTrusted) ? (bool?)__jsonIsTrusted : IsTrusted;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._isTrusted ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isTrusted) : null, "isTrusted" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCollection.cs new file mode 100644 index 000000000000..7c10fe2d46b5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Gateway list representation. + public partial class GatewayCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract[] Value { get => this._value; } + + /// Creates an new instance. + public GatewayCollection() + { + + } + } + /// Paged Gateway list representation. + public partial interface IGatewayCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract[] Value { get; } + + } + /// Paged Gateway list representation. + internal partial interface IGatewayCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCollection.json.cs new file mode 100644 index 000000000000..4d8f17631c80 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Gateway list representation. + public partial class GatewayCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContract.cs new file mode 100644 index 000000000000..8044d64114c0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContract.cs @@ -0,0 +1,190 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway details. + public partial class GatewayContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Gateway description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).Description = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// The city or locality where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LocationDataCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).LocationDataCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).LocationDataCity = value ?? null; } + + /// The country or region where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LocationDataCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).LocationDataCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).LocationDataCountryOrRegion = value ?? null; } + + /// The district, state, or province where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LocationDataDistrict { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).LocationDataDistrict; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).LocationDataDistrict = value ?? null; } + + /// A canonical name for the geographic or physical location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LocationDataName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).LocationDataName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).LocationDataName = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for LocationData + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractInternal.LocationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).LocationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal)Property).LocationData = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractProperties _property; + + /// Gateway details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public GatewayContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Gateway details. + public partial interface IGatewayContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Gateway description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// The city or locality where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The city or locality where the resource is located.", + SerializedName = @"city", + PossibleTypes = new [] { typeof(string) })] + string LocationDataCity { get; set; } + /// The country or region where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The country or region where the resource is located.", + SerializedName = @"countryOrRegion", + PossibleTypes = new [] { typeof(string) })] + string LocationDataCountryOrRegion { get; set; } + /// The district, state, or province where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The district, state, or province where the resource is located.", + SerializedName = @"district", + PossibleTypes = new [] { typeof(string) })] + string LocationDataDistrict { get; set; } + /// A canonical name for the geographic or physical location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A canonical name for the geographic or physical location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string LocationDataName { get; set; } + + } + /// Gateway details. + internal partial interface IGatewayContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Gateway description + string Description { get; set; } + + string ETag { get; set; } + /// Gateway location. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContract LocationData { get; set; } + /// The city or locality where the resource is located. + string LocationDataCity { get; set; } + /// The country or region where the resource is located. + string LocationDataCountryOrRegion { get; set; } + /// The district, state, or province where the resource is located. + string LocationDataDistrict { get; set; } + /// A canonical name for the geographic or physical location. + string LocationDataName { get; set; } + /// Gateway details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContract.json.cs new file mode 100644 index 000000000000..324fb6568b32 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway details. + public partial class GatewayContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContractProperties.cs new file mode 100644 index 000000000000..93d65ec0182d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContractProperties.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Gateway contract. + public partial class GatewayContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Gateway description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContract _locationData; + + /// Gateway location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContract LocationData { get => (this._locationData = this._locationData ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceLocationDataContract()); set => this._locationData = value; } + + /// The city or locality where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LocationDataCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContractInternal)LocationData).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContractInternal)LocationData).City = value ?? null; } + + /// The country or region where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LocationDataCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContractInternal)LocationData).CountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContractInternal)LocationData).CountryOrRegion = value ?? null; } + + /// The district, state, or province where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LocationDataDistrict { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContractInternal)LocationData).District; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContractInternal)LocationData).District = value ?? null; } + + /// A canonical name for the geographic or physical location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LocationDataName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContractInternal)LocationData).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContractInternal)LocationData).Name = value ?? null; } + + /// Internal Acessors for LocationData + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractPropertiesInternal.LocationData { get => (this._locationData = this._locationData ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceLocationDataContract()); set { {_locationData = value;} } } + + /// Creates an new instance. + public GatewayContractProperties() + { + + } + } + /// Properties of the Gateway contract. + public partial interface IGatewayContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Gateway description + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The city or locality where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The city or locality where the resource is located.", + SerializedName = @"city", + PossibleTypes = new [] { typeof(string) })] + string LocationDataCity { get; set; } + /// The country or region where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The country or region where the resource is located.", + SerializedName = @"countryOrRegion", + PossibleTypes = new [] { typeof(string) })] + string LocationDataCountryOrRegion { get; set; } + /// The district, state, or province where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The district, state, or province where the resource is located.", + SerializedName = @"district", + PossibleTypes = new [] { typeof(string) })] + string LocationDataDistrict { get; set; } + /// A canonical name for the geographic or physical location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A canonical name for the geographic or physical location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string LocationDataName { get; set; } + + } + /// Properties of the Gateway contract. + internal partial interface IGatewayContractPropertiesInternal + + { + /// Gateway description + string Description { get; set; } + /// Gateway location. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContract LocationData { get; set; } + /// The city or locality where the resource is located. + string LocationDataCity { get; set; } + /// The country or region where the resource is located. + string LocationDataCountryOrRegion { get; set; } + /// The district, state, or province where the resource is located. + string LocationDataDistrict { get; set; } + /// A canonical name for the geographic or physical location. + string LocationDataName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContractProperties.json.cs new file mode 100644 index 000000000000..d1bceca144f8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayContractProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the Gateway contract. + public partial class GatewayContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_locationData = If( json?.PropertyT("locationData"), out var __jsonLocationData) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceLocationDataContract.FromJson(__jsonLocationData) : LocationData;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._locationData ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._locationData.ToJson(null,serializationMode) : null, "locationData" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayDebugCredentialsContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayDebugCredentialsContract.cs new file mode 100644 index 000000000000..0fd5b74845b1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayDebugCredentialsContract.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway debug credentials. + public partial class GatewayDebugCredentialsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayDebugCredentialsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayDebugCredentialsContractInternal + { + + /// Backing field for property. + private string _token; + + /// Gateway debug token. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Token { get => this._token; set => this._token = value; } + + /// Creates an new instance. + public GatewayDebugCredentialsContract() + { + + } + } + /// Gateway debug credentials. + public partial interface IGatewayDebugCredentialsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Gateway debug token. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway debug token.", + SerializedName = @"token", + PossibleTypes = new [] { typeof(string) })] + string Token { get; set; } + + } + /// Gateway debug credentials. + internal partial interface IGatewayDebugCredentialsContractInternal + + { + /// Gateway debug token. + string Token { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayDebugCredentialsContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayDebugCredentialsContract.json.cs new file mode 100644 index 000000000000..3f0a7bc388e7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayDebugCredentialsContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway debug credentials. + public partial class GatewayDebugCredentialsContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayDebugCredentialsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayDebugCredentialsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayDebugCredentialsContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayDebugCredentialsContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayDebugCredentialsContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_token = If( json?.PropertyT("token"), out var __jsonToken) ? (string)__jsonToken : (string)Token;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._token)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._token.ToString()) : null, "token" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationCollection.cs new file mode 100644 index 000000000000..0726ea2fc9b2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationCollection.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Gateway hostname configuration list representation. + public partial class GatewayHostnameConfigurationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract[] Value { get => this._value; } + + /// Creates an new instance. + public GatewayHostnameConfigurationCollection() + { + + } + } + /// Paged Gateway hostname configuration list representation. + public partial interface IGatewayHostnameConfigurationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract[] Value { get; } + + } + /// Paged Gateway hostname configuration list representation. + internal partial interface IGatewayHostnameConfigurationCollectionInternal + + { + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationCollection.json.cs new file mode 100644 index 000000000000..c5df722445d9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationCollection.json.cs @@ -0,0 +1,125 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Gateway hostname configuration list representation. + public partial class GatewayHostnameConfigurationCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayHostnameConfigurationCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayHostnameConfigurationCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayHostnameConfigurationContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContract.cs new file mode 100644 index 000000000000..fcd21346121d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContract.cs @@ -0,0 +1,205 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway hostname configuration details. + public partial class GatewayHostnameConfigurationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// Identifier of Certificate entity that will be used for TLS connection establishment + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string CertificateId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).CertificateId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).CertificateId = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Hostname value. Supports valid domain name, partial or full wildcard + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Hostname { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Hostname; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Hostname = value ?? null; } + + /// Specifies if HTTP/2.0 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Http2Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Http2Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Http2Enabled = value ?? default(bool); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayHostnameConfigurationContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Determines whether gateway requests client certificate + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? NegotiateClientCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).NegotiateClientCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).NegotiateClientCertificate = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractProperties _property; + + /// Gateway hostname configuration details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayHostnameConfigurationContractProperties()); set => this._property = value; } + + /// Specifies if TLS 1.0 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Tls10Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Tls10Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Tls10Enabled = value ?? default(bool); } + + /// Specifies if TLS 1.1 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Tls11Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Tls11Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal)Property).Tls11Enabled = value ?? default(bool); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public GatewayHostnameConfigurationContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Gateway hostname configuration details. + public partial interface IGatewayHostnameConfigurationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// Identifier of Certificate entity that will be used for TLS connection establishment + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of Certificate entity that will be used for TLS connection establishment", + SerializedName = @"certificateId", + PossibleTypes = new [] { typeof(string) })] + string CertificateId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Hostname value. Supports valid domain name, partial or full wildcard + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Hostname value. Supports valid domain name, partial or full wildcard", + SerializedName = @"hostname", + PossibleTypes = new [] { typeof(string) })] + string Hostname { get; set; } + /// Specifies if HTTP/2.0 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if HTTP/2.0 is supported", + SerializedName = @"http2Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Http2Enabled { get; set; } + /// Determines whether gateway requests client certificate + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether gateway requests client certificate", + SerializedName = @"negotiateClientCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? NegotiateClientCertificate { get; set; } + /// Specifies if TLS 1.0 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if TLS 1.0 is supported", + SerializedName = @"tls10Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Tls10Enabled { get; set; } + /// Specifies if TLS 1.1 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if TLS 1.1 is supported", + SerializedName = @"tls11Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Tls11Enabled { get; set; } + + } + /// Gateway hostname configuration details. + internal partial interface IGatewayHostnameConfigurationContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// Identifier of Certificate entity that will be used for TLS connection establishment + /// + string CertificateId { get; set; } + + string ETag { get; set; } + /// Hostname value. Supports valid domain name, partial or full wildcard + string Hostname { get; set; } + /// Specifies if HTTP/2.0 is supported + bool? Http2Enabled { get; set; } + /// Determines whether gateway requests client certificate + bool? NegotiateClientCertificate { get; set; } + /// Gateway hostname configuration details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractProperties Property { get; set; } + /// Specifies if TLS 1.0 is supported + bool? Tls10Enabled { get; set; } + /// Specifies if TLS 1.1 is supported + bool? Tls11Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContract.json.cs new file mode 100644 index 000000000000..2ca9c6fa7b32 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContract.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway hostname configuration details. + public partial class GatewayHostnameConfigurationContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayHostnameConfigurationContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayHostnameConfigurationContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GatewayHostnameConfigurationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContractProperties.cs new file mode 100644 index 000000000000..754904f5e9f7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContractProperties.cs @@ -0,0 +1,144 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway hostname configuration details. + public partial class GatewayHostnameConfigurationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractPropertiesInternal + { + + /// Backing field for property. + private string _certificateId; + + /// + /// Identifier of Certificate entity that will be used for TLS connection establishment + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string CertificateId { get => this._certificateId; set => this._certificateId = value; } + + /// Backing field for property. + private string _hostname; + + /// Hostname value. Supports valid domain name, partial or full wildcard + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Hostname { get => this._hostname; set => this._hostname = value; } + + /// Backing field for property. + private bool? _http2Enabled; + + /// Specifies if HTTP/2.0 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Http2Enabled { get => this._http2Enabled; set => this._http2Enabled = value; } + + /// Backing field for property. + private bool? _negotiateClientCertificate; + + /// Determines whether gateway requests client certificate + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? NegotiateClientCertificate { get => this._negotiateClientCertificate; set => this._negotiateClientCertificate = value; } + + /// Backing field for property. + private bool? _tls10Enabled; + + /// Specifies if TLS 1.0 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Tls10Enabled { get => this._tls10Enabled; set => this._tls10Enabled = value; } + + /// Backing field for property. + private bool? _tls11Enabled; + + /// Specifies if TLS 1.1 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Tls11Enabled { get => this._tls11Enabled; set => this._tls11Enabled = value; } + + /// + /// Creates an new instance. + /// + public GatewayHostnameConfigurationContractProperties() + { + + } + } + /// Gateway hostname configuration details. + public partial interface IGatewayHostnameConfigurationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Identifier of Certificate entity that will be used for TLS connection establishment + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of Certificate entity that will be used for TLS connection establishment", + SerializedName = @"certificateId", + PossibleTypes = new [] { typeof(string) })] + string CertificateId { get; set; } + /// Hostname value. Supports valid domain name, partial or full wildcard + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Hostname value. Supports valid domain name, partial or full wildcard", + SerializedName = @"hostname", + PossibleTypes = new [] { typeof(string) })] + string Hostname { get; set; } + /// Specifies if HTTP/2.0 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if HTTP/2.0 is supported", + SerializedName = @"http2Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Http2Enabled { get; set; } + /// Determines whether gateway requests client certificate + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether gateway requests client certificate", + SerializedName = @"negotiateClientCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? NegotiateClientCertificate { get; set; } + /// Specifies if TLS 1.0 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if TLS 1.0 is supported", + SerializedName = @"tls10Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Tls10Enabled { get; set; } + /// Specifies if TLS 1.1 is supported + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if TLS 1.1 is supported", + SerializedName = @"tls11Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Tls11Enabled { get; set; } + + } + /// Gateway hostname configuration details. + internal partial interface IGatewayHostnameConfigurationContractPropertiesInternal + + { + /// + /// Identifier of Certificate entity that will be used for TLS connection establishment + /// + string CertificateId { get; set; } + /// Hostname value. Supports valid domain name, partial or full wildcard + string Hostname { get; set; } + /// Specifies if HTTP/2.0 is supported + bool? Http2Enabled { get; set; } + /// Determines whether gateway requests client certificate + bool? NegotiateClientCertificate { get; set; } + /// Specifies if TLS 1.0 is supported + bool? Tls10Enabled { get; set; } + /// Specifies if TLS 1.1 is supported + bool? Tls11Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContractProperties.json.cs new file mode 100644 index 000000000000..873d6dfb8e57 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayHostnameConfigurationContractProperties.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway hostname configuration details. + public partial class GatewayHostnameConfigurationContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayHostnameConfigurationContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayHostnameConfigurationContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayHostnameConfigurationContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_hostname = If( json?.PropertyT("hostname"), out var __jsonHostname) ? (string)__jsonHostname : (string)Hostname;} + {_certificateId = If( json?.PropertyT("certificateId"), out var __jsonCertificateId) ? (string)__jsonCertificateId : (string)CertificateId;} + {_negotiateClientCertificate = If( json?.PropertyT("negotiateClientCertificate"), out var __jsonNegotiateClientCertificate) ? (bool?)__jsonNegotiateClientCertificate : NegotiateClientCertificate;} + {_tls10Enabled = If( json?.PropertyT("tls10Enabled"), out var __jsonTls10Enabled) ? (bool?)__jsonTls10Enabled : Tls10Enabled;} + {_tls11Enabled = If( json?.PropertyT("tls11Enabled"), out var __jsonTls11Enabled) ? (bool?)__jsonTls11Enabled : Tls11Enabled;} + {_http2Enabled = If( json?.PropertyT("http2Enabled"), out var __jsonHttp2Enabled) ? (bool?)__jsonHttp2Enabled : Http2Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._hostname)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._hostname.ToString()) : null, "hostname" ,container.Add ); + AddIf( null != (((object)this._certificateId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._certificateId.ToString()) : null, "certificateId" ,container.Add ); + AddIf( null != this._negotiateClientCertificate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._negotiateClientCertificate) : null, "negotiateClientCertificate" ,container.Add ); + AddIf( null != this._tls10Enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._tls10Enabled) : null, "tls10Enabled" ,container.Add ); + AddIf( null != this._tls11Enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._tls11Enabled) : null, "tls11Enabled" ,container.Add ); + AddIf( null != this._http2Enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._http2Enabled) : null, "http2Enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeyRegenerationRequestContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeyRegenerationRequestContract.cs new file mode 100644 index 000000000000..9fa414662525 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeyRegenerationRequestContract.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway key regeneration request contract properties. + public partial class GatewayKeyRegenerationRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeyRegenerationRequestContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeyRegenerationRequestContractInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType _keyType; + + /// The Key being regenerated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType KeyType { get => this._keyType; set => this._keyType = value; } + + /// Creates an new instance. + public GatewayKeyRegenerationRequestContract() + { + + } + } + /// Gateway key regeneration request contract properties. + public partial interface IGatewayKeyRegenerationRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The Key being regenerated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Key being regenerated.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType KeyType { get; set; } + + } + /// Gateway key regeneration request contract properties. + internal partial interface IGatewayKeyRegenerationRequestContractInternal + + { + /// The Key being regenerated. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType KeyType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeyRegenerationRequestContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeyRegenerationRequestContract.json.cs new file mode 100644 index 000000000000..c4cc0ecb7eb5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeyRegenerationRequestContract.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway key regeneration request contract properties. + public partial class GatewayKeyRegenerationRequestContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeyRegenerationRequestContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeyRegenerationRequestContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeyRegenerationRequestContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayKeyRegenerationRequestContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayKeyRegenerationRequestContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyType = If( json?.PropertyT("keyType"), out var __jsonKeyType) ? (string)__jsonKeyType : (string)KeyType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._keyType.ToString()) : null, "keyType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeysContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeysContract.cs new file mode 100644 index 000000000000..f8d8a8d3ac63 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeysContract.cs @@ -0,0 +1,92 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway authentication keys. + public partial class GatewayKeysContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeysContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeysContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Backing field for property. + private string _primary; + + /// Primary gateway key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Primary { get => this._primary; set => this._primary = value; } + + /// Backing field for property. + private string _secondary; + + /// Secondary gateway key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Secondary { get => this._secondary; set => this._secondary = value; } + + /// Creates an new instance. + public GatewayKeysContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeysContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + /// Gateway authentication keys. + public partial interface IGatewayKeysContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Primary gateway key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Primary gateway key.", + SerializedName = @"primary", + PossibleTypes = new [] { typeof(string) })] + string Primary { get; set; } + /// Secondary gateway key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secondary gateway key.", + SerializedName = @"secondary", + PossibleTypes = new [] { typeof(string) })] + string Secondary { get; set; } + + } + /// Gateway authentication keys. + internal partial interface IGatewayKeysContractInternal + + { + string ETag { get; set; } + /// Primary gateway key. + string Primary { get; set; } + /// Secondary gateway key. + string Secondary { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeysContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeysContract.json.cs new file mode 100644 index 000000000000..11217a8b00d7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayKeysContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway authentication keys. + public partial class GatewayKeysContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeysContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeysContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayKeysContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayKeysContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayKeysContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_primary = If( json?.PropertyT("primary"), out var __jsonPrimary) ? (string)__jsonPrimary : (string)Primary;} + {_secondary = If( json?.PropertyT("secondary"), out var __jsonSecondary) ? (string)__jsonSecondary : (string)Secondary;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._primary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._primary.ToString()) : null, "primary" ,container.Add ); + AddIf( null != (((object)this._secondary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._secondary.ToString()) : null, "secondary" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListDebugCredentialsContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListDebugCredentialsContract.cs new file mode 100644 index 000000000000..fef9f8bd9a27 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListDebugCredentialsContract.cs @@ -0,0 +1,94 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// List debug credentials properties. + public partial class GatewayListDebugCredentialsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListDebugCredentialsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListDebugCredentialsContractInternal + { + + /// Backing field for property. + private string _apiId; + + /// Full resource Id of an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiId { get => this._apiId; set => this._apiId = value; } + + /// Backing field for property. + private global::System.TimeSpan? _credentialsExpireAfter; + + /// + /// Credentials expiration in ISO8601 format. Maximum duration of the credentials is PT1H. When property is not specified, + /// them value PT1H is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.TimeSpan? CredentialsExpireAfter { get => this._credentialsExpireAfter; set => this._credentialsExpireAfter = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose[] _purpos; + + /// Purposes of debug credential. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose[] Purpos { get => this._purpos; set => this._purpos = value; } + + /// Creates an new instance. + public GatewayListDebugCredentialsContract() + { + + } + } + /// List debug credentials properties. + public partial interface IGatewayListDebugCredentialsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Full resource Id of an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Full resource Id of an API.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + /// + /// Credentials expiration in ISO8601 format. Maximum duration of the credentials is PT1H. When property is not specified, + /// them value PT1H is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Credentials expiration in ISO8601 format. Maximum duration of the credentials is PT1H. When property is not specified, them value PT1H is used.", + SerializedName = @"credentialsExpireAfter", + PossibleTypes = new [] { typeof(global::System.TimeSpan) })] + global::System.TimeSpan? CredentialsExpireAfter { get; set; } + /// Purposes of debug credential. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Purposes of debug credential.", + SerializedName = @"purposes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose[] Purpos { get; set; } + + } + /// List debug credentials properties. + internal partial interface IGatewayListDebugCredentialsContractInternal + + { + /// Full resource Id of an API. + string ApiId { get; set; } + /// + /// Credentials expiration in ISO8601 format. Maximum duration of the credentials is PT1H. When property is not specified, + /// them value PT1H is used. + /// + global::System.TimeSpan? CredentialsExpireAfter { get; set; } + /// Purposes of debug credential. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose[] Purpos { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListDebugCredentialsContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListDebugCredentialsContract.json.cs new file mode 100644 index 000000000000..4ea6d66e4aeb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListDebugCredentialsContract.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// List debug credentials properties. + public partial class GatewayListDebugCredentialsContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListDebugCredentialsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListDebugCredentialsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListDebugCredentialsContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayListDebugCredentialsContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayListDebugCredentialsContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_credentialsExpireAfter = If( json?.PropertyT("credentialsExpireAfter"), out var __jsonCredentialsExpireAfter) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonCredentialsExpireAfter ) : CredentialsExpireAfter;} + {_purpos = If( json?.PropertyT("purposes"), out var __jsonPurposes) ? If( __jsonPurposes as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose)""))) ))() : null : Purpos;} + {_apiId = If( json?.PropertyT("apiId"), out var __jsonApiId) ? (string)__jsonApiId : (string)ApiId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)(null != this._credentialsExpireAfter ? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._credentialsExpireAfter)): null), "credentialsExpireAfter" ,container.Add ); + if (null != this._purpos) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._purpos ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("purposes",__w); + } + AddIf( null != (((object)this._apiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiId.ToString()) : null, "apiId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListTraceContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListTraceContract.cs new file mode 100644 index 000000000000..b41e143d0910 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListTraceContract.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// List trace properties. + public partial class GatewayListTraceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListTraceContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListTraceContractInternal + { + + /// Backing field for property. + private string _traceId; + + /// Trace id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TraceId { get => this._traceId; set => this._traceId = value; } + + /// Creates an new instance. + public GatewayListTraceContract() + { + + } + } + /// List trace properties. + public partial interface IGatewayListTraceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Trace id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Trace id.", + SerializedName = @"traceId", + PossibleTypes = new [] { typeof(string) })] + string TraceId { get; set; } + + } + /// List trace properties. + internal partial interface IGatewayListTraceContractInternal + + { + /// Trace id. + string TraceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListTraceContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListTraceContract.json.cs new file mode 100644 index 000000000000..337c8bc8ed20 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayListTraceContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// List trace properties. + public partial class GatewayListTraceContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListTraceContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListTraceContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayListTraceContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayListTraceContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayListTraceContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_traceId = If( json?.PropertyT("traceId"), out var __jsonTraceId) ? (string)__jsonTraceId : (string)TraceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._traceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._traceId.ToString()) : null, "traceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenContract.cs new file mode 100644 index 000000000000..e10e3be01e15 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenContract.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway access token. + public partial class GatewayTokenContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenContractInternal + { + + /// Backing field for property. + private string _value; + + /// Shared Access Authentication token value for the Gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public GatewayTokenContract() + { + + } + } + /// Gateway access token. + public partial interface IGatewayTokenContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Shared Access Authentication token value for the Gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Shared Access Authentication token value for the Gateway.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Gateway access token. + internal partial interface IGatewayTokenContractInternal + + { + /// Shared Access Authentication token value for the Gateway. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenContract.json.cs new file mode 100644 index 000000000000..fe5ecec384d1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway access token. + public partial class GatewayTokenContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayTokenContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayTokenContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenRequestContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenRequestContract.cs new file mode 100644 index 000000000000..87cbd4b5d16d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenRequestContract.cs @@ -0,0 +1,78 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway token request contract properties. + public partial class GatewayTokenRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenRequestContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenRequestContractInternal + { + + /// Backing field for property. + private global::System.DateTime _expiry; + + /// + /// The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: + /// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime Expiry { get => this._expiry; set => this._expiry = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType _keyType; + + /// The Key to be used to generate gateway token. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType KeyType { get => this._keyType; set => this._keyType = value; } + + /// Creates an new instance. + public GatewayTokenRequestContract() + { + + } + } + /// Gateway token request contract properties. + public partial interface IGatewayTokenRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: + /// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"expiry", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime Expiry { get; set; } + /// The Key to be used to generate gateway token. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Key to be used to generate gateway token.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType KeyType { get; set; } + + } + /// Gateway token request contract properties. + internal partial interface IGatewayTokenRequestContractInternal + + { + /// + /// The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: + /// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + global::System.DateTime Expiry { get; set; } + /// The Key to be used to generate gateway token. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType KeyType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenRequestContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenRequestContract.json.cs new file mode 100644 index 000000000000..d92dca720692 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GatewayTokenRequestContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Gateway token request contract properties. + public partial class GatewayTokenRequestContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenRequestContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenRequestContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGatewayTokenRequestContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayTokenRequestContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayTokenRequestContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyType = If( json?.PropertyT("keyType"), out var __jsonKeyType) ? (string)__jsonKeyType : (string)KeyType;} + {_expiry = If( json?.PropertyT("expiry"), out var __jsonExpiry) ? global::System.DateTime.TryParse((string)__jsonExpiry, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryValue) ? __jsonExpiryValue : Expiry : Expiry;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._keyType.ToString()) : null, "keyType" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._expiry.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "expiry" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GenerateSsoUrlResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GenerateSsoUrlResult.cs new file mode 100644 index 000000000000..15a1ee74295c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GenerateSsoUrlResult.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Generate SSO Url operations response details. + public partial class GenerateSsoUrlResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGenerateSsoUrlResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGenerateSsoUrlResultInternal + { + + /// Backing field for property. + private string _value; + + /// Redirect Url containing the SSO URL value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public GenerateSsoUrlResult() + { + + } + } + /// Generate SSO Url operations response details. + public partial interface IGenerateSsoUrlResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Redirect Url containing the SSO URL value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect Url containing the SSO URL value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Generate SSO Url operations response details. + internal partial interface IGenerateSsoUrlResultInternal + + { + /// Redirect Url containing the SSO URL value. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GenerateSsoUrlResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GenerateSsoUrlResult.json.cs new file mode 100644 index 000000000000..0dec8f8e69dd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GenerateSsoUrlResult.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Generate SSO Url operations response details. + public partial class GenerateSsoUrlResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGenerateSsoUrlResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGenerateSsoUrlResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGenerateSsoUrlResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GenerateSsoUrlResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateSsoUrlResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaCollection.cs new file mode 100644 index 000000000000..b6c7b7e99cff --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the list schema operation. + public partial class GlobalSchemaCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract[] _value; + + /// Global Schema Contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract[] Value { get => this._value; } + + /// Creates an new instance. + public GlobalSchemaCollection() + { + + } + } + /// The response of the list schema operation. + public partial interface IGlobalSchemaCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Global Schema Contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Global Schema Contract value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract[] Value { get; } + + } + /// The response of the list schema operation. + internal partial interface IGlobalSchemaCollectionInternal + + { + /// Total record count number. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Global Schema Contract value. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaCollection.json.cs new file mode 100644 index 000000000000..5a6e1f5e3fe3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the list schema operation. + public partial class GlobalSchemaCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GlobalSchemaCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GlobalSchemaCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GlobalSchemaContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContract.cs new file mode 100644 index 000000000000..3e96d28bb0c5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContract.cs @@ -0,0 +1,226 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Global Schema Contract details. + public partial class GlobalSchemaContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Free-form schema entity description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).Description = value ?? null; } + + /// Global Schema document object for json-based schema formats(e.g. json schema). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Document { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).Document; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).Document = value ?? null /* model class */; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GlobalSchemaContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).ProvisioningState = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractProperties _property; + + /// Properties of the Global Schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GlobalSchemaContractProperties()); set => this._property = value; } + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).ProvisioningState; } + + /// Schema Type. Immutable. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType? SchemaType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).SchemaType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).SchemaType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Json-encoded string for non json-based schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal)Property).Value = value ?? null /* model class */; } + + /// Creates an new instance. + public GlobalSchemaContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + if (headers.TryGetValues("location", out var __locationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader1) is string __headerLocationHeader1 ? __headerLocationHeader1 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader2)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader2) is string __headerAzureAsyncOperationHeader2 ? __headerAzureAsyncOperationHeader2 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Global Schema Contract details. + public partial interface IGlobalSchemaContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + /// Free-form schema entity description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Free-form schema entity description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Global Schema document object for json-based schema formats(e.g. json schema). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Global Schema document object for json-based schema formats(e.g. json schema).", + SerializedName = @"document", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Document { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Schema Type. Immutable. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Schema Type. Immutable.", + SerializedName = @"schemaType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType? SchemaType { get; set; } + /// Json-encoded string for non json-based schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Json-encoded string for non json-based schema.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Value { get; set; } + + } + /// Global Schema Contract details. + internal partial interface IGlobalSchemaContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string AzureAsyncOperation { get; set; } + /// Free-form schema entity description. + string Description { get; set; } + /// Global Schema document object for json-based schema formats(e.g. json schema). + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Document { get; set; } + + string ETag { get; set; } + + string Location { get; set; } + /// Properties of the Global Schema. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractProperties Property { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// Schema Type. Immutable. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType? SchemaType { get; set; } + /// Json-encoded string for non json-based schema. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContract.json.cs new file mode 100644 index 000000000000..770b61a34506 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Global Schema Contract details. + public partial class GlobalSchemaContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GlobalSchemaContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GlobalSchemaContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GlobalSchemaContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContractProperties.cs new file mode 100644 index 000000000000..c8cfd6fc2699 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContractProperties.cs @@ -0,0 +1,122 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Schema create or update contract Properties. + public partial class GlobalSchemaContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Free-form schema entity description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny _document; + + /// Global Schema document object for json-based schema formats(e.g. json schema). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Document { get => (this._document = this._document ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any()); set => this._document = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType _schemaType; + + /// Schema Type. Immutable. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType SchemaType { get => this._schemaType; set => this._schemaType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny _value; + + /// Json-encoded string for non json-based schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any()); set => this._value = value; } + + /// Creates an new instance. + public GlobalSchemaContractProperties() + { + + } + } + /// Schema create or update contract Properties. + public partial interface IGlobalSchemaContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Free-form schema entity description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Free-form schema entity description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Global Schema document object for json-based schema formats(e.g. json schema). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Global Schema document object for json-based schema formats(e.g. json schema).", + SerializedName = @"document", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Document { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Schema Type. Immutable. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Schema Type. Immutable.", + SerializedName = @"schemaType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType SchemaType { get; set; } + /// Json-encoded string for non json-based schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Json-encoded string for non json-based schema.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Value { get; set; } + + } + /// Schema create or update contract Properties. + internal partial interface IGlobalSchemaContractPropertiesInternal + + { + /// Free-form schema entity description. + string Description { get; set; } + /// Global Schema document object for json-based schema formats(e.g. json schema). + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Document { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// Schema Type. Immutable. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType SchemaType { get; set; } + /// Json-encoded string for non json-based schema. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContractProperties.json.cs new file mode 100644 index 000000000000..0eab7c885756 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GlobalSchemaContractProperties.json.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Schema create or update contract Properties. + public partial class GlobalSchemaContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGlobalSchemaContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GlobalSchemaContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GlobalSchemaContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_schemaType = If( json?.PropertyT("schemaType"), out var __jsonSchemaType) ? (string)__jsonSchemaType : (string)SchemaType;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any.FromJson(__jsonValue) : Value;} + {_document = If( json?.PropertyT("document"), out var __jsonDocument) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any.FromJson(__jsonDocument) : Document;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._schemaType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._schemaType.ToString()) : null, "schemaType" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._value.ToJson(null,serializationMode) : null, "value" ,container.Add ); + AddIf( null != this._document ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._document.ToJson(null,serializationMode) : null, "document" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCollection.cs new file mode 100644 index 000000000000..fb3175369f3e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Group list representation. + public partial class GroupCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public GroupCollection() + { + + } + } + /// Paged Group list representation. + public partial interface IGroupCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContract[] Value { get; set; } + + } + /// Paged Group list representation. + internal partial interface IGroupCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCollection.json.cs new file mode 100644 index 000000000000..3de83d1f70d5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Group list representation. + public partial class GroupCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GroupCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GroupCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContract.cs new file mode 100644 index 000000000000..7c6d3f38fe81 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContract.cs @@ -0,0 +1,203 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Contract details. + public partial class GroupContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? BuiltIn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).BuiltIn; } + + /// Group description. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).Description = value ?? null; } + + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active + /// Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ExternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).ExternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).ExternalId = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for BuiltIn + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractInternal.BuiltIn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).BuiltIn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).BuiltIn = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? PropertiesType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties _property; + + /// Group entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public GroupContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Contract details. + public partial interface IGroupContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false.", + SerializedName = @"builtIn", + PossibleTypes = new [] { typeof(bool) })] + bool? BuiltIn { get; } + /// Group description. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group description. Can contain HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active + /// Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null.", + SerializedName = @"externalId", + PossibleTypes = new [] { typeof(string) })] + string ExternalId { get; set; } + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? PropertiesType { get; set; } + + } + /// Contract details. + internal partial interface IGroupContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. + /// + bool? BuiltIn { get; set; } + /// Group description. Can contain HTML formatting tags. + string Description { get; set; } + /// Group name. + string DisplayName { get; set; } + + string ETag { get; set; } + /// + /// For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active + /// Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + string ExternalId { get; set; } + /// Group type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? PropertiesType { get; set; } + /// Group entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContract.json.cs new file mode 100644 index 000000000000..35b36b090460 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Contract details. + public partial class GroupContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GroupContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GroupContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContractProperties.cs new file mode 100644 index 000000000000..e95952e84af7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContractProperties.cs @@ -0,0 +1,137 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Group contract Properties. + public partial class GroupContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal + { + + /// Backing field for property. + private bool? _builtIn; + + /// + /// true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? BuiltIn { get => this._builtIn; } + + /// Backing field for property. + private string _description; + + /// Group description. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _displayName; + + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _externalId; + + /// + /// For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active + /// Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ExternalId { get => this._externalId; set => this._externalId = value; } + + /// Internal Acessors for BuiltIn + bool? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractPropertiesInternal.BuiltIn { get => this._builtIn; set { {_builtIn = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? _type; + + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public GroupContractProperties() + { + + } + } + /// Group contract Properties. + public partial interface IGroupContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false.", + SerializedName = @"builtIn", + PossibleTypes = new [] { typeof(bool) })] + bool? BuiltIn { get; } + /// Group description. Can contain HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group description. Can contain HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Group name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active + /// Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null.", + SerializedName = @"externalId", + PossibleTypes = new [] { typeof(string) })] + string ExternalId { get; set; } + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get; set; } + + } + /// Group contract Properties. + internal partial interface IGroupContractPropertiesInternal + + { + /// + /// true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. + /// + bool? BuiltIn { get; set; } + /// Group description. Can contain HTML formatting tags. + string Description { get; set; } + /// Group name. + string DisplayName { get; set; } + /// + /// For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active + /// Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + string ExternalId { get; set; } + /// Group type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContractProperties.json.cs new file mode 100644 index 000000000000..61a56090e617 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupContractProperties.json.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Group contract Properties. + public partial class GroupContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GroupContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GroupContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_builtIn = If( json?.PropertyT("builtIn"), out var __jsonBuiltIn) ? (bool?)__jsonBuiltIn : BuiltIn;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_externalId = If( json?.PropertyT("externalId"), out var __jsonExternalId) ? (string)__jsonExternalId : (string)ExternalId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._builtIn ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._builtIn) : null, "builtIn" ,container.Add ); + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._externalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._externalId.ToString()) : null, "externalId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParameters.cs new file mode 100644 index 000000000000..582847b62c51 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParameters.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create Group operation. + public partial class GroupCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersInternal + { + + /// Group description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersPropertiesInternal)Property).Description = value ?? null; } + + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersPropertiesInternal)Property).DisplayName = value ?? null; } + + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ExternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersPropertiesInternal)Property).ExternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersPropertiesInternal)Property).ExternalId = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupCreateParametersProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersProperties _property; + + /// Properties supplied to Create Group operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupCreateParametersProperties()); set => this._property = value; } + + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersPropertiesInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersPropertiesInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType)""); } + + /// Creates an new instance. + public GroupCreateParameters() + { + + } + } + /// Parameters supplied to the Create Group operation. + public partial interface IGroupCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Group description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null.", + SerializedName = @"externalId", + PossibleTypes = new [] { typeof(string) })] + string ExternalId { get; set; } + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get; set; } + + } + /// Parameters supplied to the Create Group operation. + internal partial interface IGroupCreateParametersInternal + + { + /// Group description. + string Description { get; set; } + /// Group name. + string DisplayName { get; set; } + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + string ExternalId { get; set; } + /// Properties supplied to Create Group operation. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersProperties Property { get; set; } + /// Group type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParameters.json.cs new file mode 100644 index 000000000000..3148e23cceda --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create Group operation. + public partial class GroupCreateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GroupCreateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GroupCreateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupCreateParametersProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParametersProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParametersProperties.cs new file mode 100644 index 000000000000..b8d9cb44beba --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParametersProperties.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create Group operation. + public partial class GroupCreateParametersProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Group description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _displayName; + + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _externalId; + + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ExternalId { get => this._externalId; set => this._externalId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? _type; + + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public GroupCreateParametersProperties() + { + + } + } + /// Parameters supplied to the Create Group operation. + public partial interface IGroupCreateParametersProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Group description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Group name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null.", + SerializedName = @"externalId", + PossibleTypes = new [] { typeof(string) })] + string ExternalId { get; set; } + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get; set; } + + } + /// Parameters supplied to the Create Group operation. + internal partial interface IGroupCreateParametersPropertiesInternal + + { + /// Group description. + string Description { get; set; } + /// Group name. + string DisplayName { get; set; } + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + string ExternalId { get; set; } + /// Group type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParametersProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParametersProperties.json.cs new file mode 100644 index 000000000000..55304e9aeef7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupCreateParametersProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create Group operation. + public partial class GroupCreateParametersProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupCreateParametersProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GroupCreateParametersProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GroupCreateParametersProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_externalId = If( json?.PropertyT("externalId"), out var __jsonExternalId) ? (string)__jsonExternalId : (string)ExternalId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._externalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._externalId.ToString()) : null, "externalId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParameters.cs new file mode 100644 index 000000000000..9ffb33372aef --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParameters.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Group operation. + public partial class GroupUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersInternal + { + + /// Group description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersPropertiesInternal)Property).Description = value ?? null; } + + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersPropertiesInternal)Property).DisplayName = value ?? null; } + + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ExternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersPropertiesInternal)Property).ExternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersPropertiesInternal)Property).ExternalId = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupUpdateParametersProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersProperties _property; + + /// Group entity update contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupUpdateParametersProperties()); set => this._property = value; } + + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersPropertiesInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersPropertiesInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType)""); } + + /// Creates an new instance. + public GroupUpdateParameters() + { + + } + } + /// Parameters supplied to the Update Group operation. + public partial interface IGroupUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Group description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null.", + SerializedName = @"externalId", + PossibleTypes = new [] { typeof(string) })] + string ExternalId { get; set; } + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get; set; } + + } + /// Parameters supplied to the Update Group operation. + internal partial interface IGroupUpdateParametersInternal + + { + /// Group description. + string Description { get; set; } + /// Group name. + string DisplayName { get; set; } + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + string ExternalId { get; set; } + /// Group entity update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersProperties Property { get; set; } + /// Group type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParameters.json.cs new file mode 100644 index 000000000000..4e559b251433 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Group operation. + public partial class GroupUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GroupUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GroupUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupUpdateParametersProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParametersProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParametersProperties.cs new file mode 100644 index 000000000000..f975c0a94c71 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParametersProperties.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Group operation. + public partial class GroupUpdateParametersProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Group description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _displayName; + + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _externalId; + + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ExternalId { get => this._externalId; set => this._externalId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? _type; + + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public GroupUpdateParametersProperties() + { + + } + } + /// Parameters supplied to the Update Group operation. + public partial interface IGroupUpdateParametersProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Group description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Group name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null.", + SerializedName = @"externalId", + PossibleTypes = new [] { typeof(string) })] + string ExternalId { get; set; } + /// Group type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get; set; } + + } + /// Parameters supplied to the Update Group operation. + internal partial interface IGroupUpdateParametersPropertiesInternal + + { + /// Group description. + string Description { get; set; } + /// Group name. + string DisplayName { get; set; } + /// + /// Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. + /// for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + /// + string ExternalId { get; set; } + /// Group type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParametersProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParametersProperties.json.cs new file mode 100644 index 000000000000..422a925d42ab --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/GroupUpdateParametersProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Group operation. + public partial class GroupUpdateParametersProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupUpdateParametersProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GroupUpdateParametersProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GroupUpdateParametersProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_externalId = If( json?.PropertyT("externalId"), out var __jsonExternalId) ? (string)__jsonExternalId : (string)ExternalId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._externalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._externalId.ToString()) : null, "externalId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HostnameConfiguration.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HostnameConfiguration.cs new file mode 100644 index 000000000000..fe76d7e3f9ee --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HostnameConfiguration.cs @@ -0,0 +1,309 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Custom hostname configuration. + public partial class HostnameConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation _certificate; + + /// Certificate information. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateInformation()); set => this._certificate = value; } + + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? CertificateExpiry { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Expiry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Expiry = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _certificatePassword; + + /// Certificate Password. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string CertificatePassword { get => this._certificatePassword; set => this._certificatePassword = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource? _certificateSource; + + /// Certificate Source. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource? CertificateSource { get => this._certificateSource; set => this._certificateSource = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus? _certificateStatus; + + /// Certificate Status. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus? CertificateStatus { get => this._certificateStatus; set => this._certificateStatus = value; } + + /// Subject of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string CertificateSubject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Subject = value ?? null; } + + /// Thumbprint of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string CertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Thumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformationInternal)Certificate).Thumbprint = value ?? null; } + + /// Backing field for property. + private bool? _defaultSslBinding; + + /// + /// Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not + /// send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has + /// multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to gateway + /// Hostname Type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? DefaultSslBinding { get => this._defaultSslBinding; set => this._defaultSslBinding = value; } + + /// Backing field for property. + private string _encodedCertificate; + + /// Base64 Encoded certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string EncodedCertificate { get => this._encodedCertificate; set => this._encodedCertificate = value; } + + /// Backing field for property. + private string _hostName; + + /// Hostname to configure on the Api Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string HostName { get => this._hostName; set => this._hostName = value; } + + /// Backing field for property. + private string _identityClientId; + + /// + /// System or User Assigned Managed identity clientId as generated by Azure AD, which has GET access to the keyVault containing + /// the SSL certificate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string IdentityClientId { get => this._identityClientId; set => this._identityClientId = value; } + + /// Backing field for property. + private string _keyVaultId; + + /// + /// Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update + /// of ssl certificate will not work. This requires Api Management service to be configured with aka.ms/apimmsi. The secret + /// should be of type *application/x-pkcs12* + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string KeyVaultId { get => this._keyVaultId; set => this._keyVaultId = value; } + + /// Internal Acessors for Certificate + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfigurationInternal.Certificate { get => (this._certificate = this._certificate ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateInformation()); set { {_certificate = value;} } } + + /// Backing field for property. + private bool? _negotiateClientCertificate; + + /// + /// Specify true to always negotiate client certificate on the hostname. Default Value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? NegotiateClientCertificate { get => this._negotiateClientCertificate; set => this._negotiateClientCertificate = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType _type; + + /// Hostname type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public HostnameConfiguration() + { + + } + } + /// Custom hostname configuration. + public partial interface IHostnameConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.", + SerializedName = @"expiry", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CertificateExpiry { get; set; } + /// Certificate Password. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate Password.", + SerializedName = @"certificatePassword", + PossibleTypes = new [] { typeof(string) })] + string CertificatePassword { get; set; } + /// Certificate Source. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate Source.", + SerializedName = @"certificateSource", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource? CertificateSource { get; set; } + /// Certificate Status. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate Status.", + SerializedName = @"certificateStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus? CertificateStatus { get; set; } + /// Subject of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subject of the certificate.", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string CertificateSubject { get; set; } + /// Thumbprint of the certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint of the certificate.", + SerializedName = @"thumbprint", + PossibleTypes = new [] { typeof(string) })] + string CertificateThumbprint { get; set; } + /// + /// Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not + /// send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has + /// multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to gateway + /// Hostname Type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to gateway Hostname Type.", + SerializedName = @"defaultSslBinding", + PossibleTypes = new [] { typeof(bool) })] + bool? DefaultSslBinding { get; set; } + /// Base64 Encoded certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Base64 Encoded certificate.", + SerializedName = @"encodedCertificate", + PossibleTypes = new [] { typeof(string) })] + string EncodedCertificate { get; set; } + /// Hostname to configure on the Api Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Hostname to configure on the Api Management service.", + SerializedName = @"hostName", + PossibleTypes = new [] { typeof(string) })] + string HostName { get; set; } + /// + /// System or User Assigned Managed identity clientId as generated by Azure AD, which has GET access to the keyVault containing + /// the SSL certificate. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"System or User Assigned Managed identity clientId as generated by Azure AD, which has GET access to the keyVault containing the SSL certificate.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string IdentityClientId { get; set; } + /// + /// Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update + /// of ssl certificate will not work. This requires Api Management service to be configured with aka.ms/apimmsi. The secret + /// should be of type *application/x-pkcs12* + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to be configured with aka.ms/apimmsi. The secret should be of type *application/x-pkcs12*", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultId { get; set; } + /// + /// Specify true to always negotiate client certificate on the hostname. Default Value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify true to always negotiate client certificate on the hostname. Default Value is false.", + SerializedName = @"negotiateClientCertificate", + PossibleTypes = new [] { typeof(bool) })] + bool? NegotiateClientCertificate { get; set; } + /// Hostname type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Hostname type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType Type { get; set; } + + } + /// Custom hostname configuration. + internal partial interface IHostnameConfigurationInternal + + { + /// Certificate information. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ICertificateInformation Certificate { get; set; } + /// + /// Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + /// the ISO 8601 standard. + /// + global::System.DateTime? CertificateExpiry { get; set; } + /// Certificate Password. + string CertificatePassword { get; set; } + /// Certificate Source. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource? CertificateSource { get; set; } + /// Certificate Status. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus? CertificateStatus { get; set; } + /// Subject of the certificate. + string CertificateSubject { get; set; } + /// Thumbprint of the certificate. + string CertificateThumbprint { get; set; } + /// + /// Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not + /// send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has + /// multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to gateway + /// Hostname Type. + /// + bool? DefaultSslBinding { get; set; } + /// Base64 Encoded certificate. + string EncodedCertificate { get; set; } + /// Hostname to configure on the Api Management service. + string HostName { get; set; } + /// + /// System or User Assigned Managed identity clientId as generated by Azure AD, which has GET access to the keyVault containing + /// the SSL certificate. + /// + string IdentityClientId { get; set; } + /// + /// Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update + /// of ssl certificate will not work. This requires Api Management service to be configured with aka.ms/apimmsi. The secret + /// should be of type *application/x-pkcs12* + /// + string KeyVaultId { get; set; } + /// + /// Specify true to always negotiate client certificate on the hostname. Default Value is false. + /// + bool? NegotiateClientCertificate { get; set; } + /// Hostname type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HostnameConfiguration.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HostnameConfiguration.json.cs new file mode 100644 index 000000000000..a2bca03f910e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HostnameConfiguration.json.cs @@ -0,0 +1,128 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Custom hostname configuration. + public partial class HostnameConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHostnameConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new HostnameConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal HostnameConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_certificate = If( json?.PropertyT("certificate"), out var __jsonCertificate) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.CertificateInformation.FromJson(__jsonCertificate) : Certificate;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_hostName = If( json?.PropertyT("hostName"), out var __jsonHostName) ? (string)__jsonHostName : (string)HostName;} + {_keyVaultId = If( json?.PropertyT("keyVaultId"), out var __jsonKeyVaultId) ? (string)__jsonKeyVaultId : (string)KeyVaultId;} + {_identityClientId = If( json?.PropertyT("identityClientId"), out var __jsonIdentityClientId) ? (string)__jsonIdentityClientId : (string)IdentityClientId;} + {_encodedCertificate = If( json?.PropertyT("encodedCertificate"), out var __jsonEncodedCertificate) ? (string)__jsonEncodedCertificate : (string)EncodedCertificate;} + {_certificatePassword = If( json?.PropertyT("certificatePassword"), out var __jsonCertificatePassword) ? (string)__jsonCertificatePassword : (string)CertificatePassword;} + {_defaultSslBinding = If( json?.PropertyT("defaultSslBinding"), out var __jsonDefaultSslBinding) ? (bool?)__jsonDefaultSslBinding : DefaultSslBinding;} + {_negotiateClientCertificate = If( json?.PropertyT("negotiateClientCertificate"), out var __jsonNegotiateClientCertificate) ? (bool?)__jsonNegotiateClientCertificate : NegotiateClientCertificate;} + {_certificateSource = If( json?.PropertyT("certificateSource"), out var __jsonCertificateSource) ? (string)__jsonCertificateSource : (string)CertificateSource;} + {_certificateStatus = If( json?.PropertyT("certificateStatus"), out var __jsonCertificateStatus) ? (string)__jsonCertificateStatus : (string)CertificateStatus;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._certificate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._certificate.ToJson(null,serializationMode) : null, "certificate" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._hostName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._hostName.ToString()) : null, "hostName" ,container.Add ); + AddIf( null != (((object)this._keyVaultId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._keyVaultId.ToString()) : null, "keyVaultId" ,container.Add ); + AddIf( null != (((object)this._identityClientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._identityClientId.ToString()) : null, "identityClientId" ,container.Add ); + AddIf( null != (((object)this._encodedCertificate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._encodedCertificate.ToString()) : null, "encodedCertificate" ,container.Add ); + AddIf( null != (((object)this._certificatePassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._certificatePassword.ToString()) : null, "certificatePassword" ,container.Add ); + AddIf( null != this._defaultSslBinding ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._defaultSslBinding) : null, "defaultSslBinding" ,container.Add ); + AddIf( null != this._negotiateClientCertificate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._negotiateClientCertificate) : null, "negotiateClientCertificate" ,container.Add ); + AddIf( null != (((object)this._certificateSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._certificateSource.ToString()) : null, "certificateSource" ,container.Add ); + AddIf( null != (((object)this._certificateStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._certificateStatus.ToString()) : null, "certificateStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpHeader.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpHeader.cs new file mode 100644 index 000000000000..f17cfdb75a0e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpHeader.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// HTTP header and it's value. + public partial class HttpHeader : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeaderInternal + { + + /// Backing field for property. + private string _name; + + /// Header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _value; + + /// Header value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public HttpHeader() + { + + } + } + /// HTTP header and it's value. + public partial interface IHttpHeader : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Header name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Header value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Header value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// HTTP header and it's value. + internal partial interface IHttpHeaderInternal + + { + /// Header name. + string Name { get; set; } + /// Header value. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpHeader.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpHeader.json.cs new file mode 100644 index 000000000000..6eab89f8bcac --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpHeader.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// HTTP header and it's value. + public partial class HttpHeader + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpHeader FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new HttpHeader(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal HttpHeader(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpMessageDiagnostic.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpMessageDiagnostic.cs new file mode 100644 index 000000000000..c41b4cf69b40 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpMessageDiagnostic.cs @@ -0,0 +1,117 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Http message diagnostic settings. + public partial class HttpMessageDiagnostic : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings _body; + + /// Body logging settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Body { get => (this._body = this._body ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BodyDiagnosticSettings()); set => this._body = value; } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? BodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettingsInternal)Body).Byte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettingsInternal)Body).Byte = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking _dataMasking; + + /// Data masking settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking DataMasking { get => (this._dataMasking = this._dataMasking ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DataMasking()); set => this._dataMasking = value; } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] DataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingInternal)DataMasking).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingInternal)DataMasking).Header = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] DataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingInternal)DataMasking).QueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingInternal)DataMasking).QueryParam = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string[] _header; + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Header { get => this._header; set => this._header = value; } + + /// Internal Acessors for Body + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal.Body { get => (this._body = this._body ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BodyDiagnosticSettings()); set { {_body = value;} } } + + /// Internal Acessors for DataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal.DataMasking { get => (this._dataMasking = this._dataMasking ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DataMasking()); set { {_dataMasking = value;} } } + + /// Creates an new instance. + public HttpMessageDiagnostic() + { + + } + } + /// Http message diagnostic settings. + public partial interface IHttpMessageDiagnostic : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? BodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] DataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] DataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] Header { get; set; } + + } + /// Http message diagnostic settings. + internal partial interface IHttpMessageDiagnosticInternal + + { + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Body { get; set; } + /// Number of request body bytes to log. + int? BodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking DataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] DataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] DataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] Header { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpMessageDiagnostic.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpMessageDiagnostic.json.cs new file mode 100644 index 000000000000..7833223e35b4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/HttpMessageDiagnostic.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Http message diagnostic settings. + public partial class HttpMessageDiagnostic + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new HttpMessageDiagnostic(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal HttpMessageDiagnostic(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_body = If( json?.PropertyT("body"), out var __jsonBody) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.BodyDiagnosticSettings.FromJson(__jsonBody) : Body;} + {_dataMasking = If( json?.PropertyT("dataMasking"), out var __jsonDataMasking) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.DataMasking.FromJson(__jsonDataMasking) : DataMasking;} + {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? If( __jsonHeaders as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Header;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._body ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._body.ToJson(null,serializationMode) : null, "body" ,container.Add ); + AddIf( null != this._dataMasking ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._dataMasking.ToJson(null,serializationMode) : null, "dataMasking" ,container.Add ); + if (null != this._header) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._header ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("headers",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderBaseParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderBaseParameters.cs new file mode 100644 index 000000000000..74df6e3504db --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderBaseParameters.cs @@ -0,0 +1,193 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity Provider Base Parameter Properties. + public partial class IdentityProviderBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal + { + + /// Backing field for property. + private string[] _allowedTenant; + + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] AllowedTenant { get => this._allowedTenant; set => this._allowedTenant = value; } + + /// Backing field for property. + private string _authority; + + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Authority { get => this._authority; set => this._authority = value; } + + /// Backing field for property. + private string _clientLibrary; + + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientLibrary { get => this._clientLibrary; set => this._clientLibrary = value; } + + /// Backing field for property. + private string _passwordResetPolicyName; + + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PasswordResetPolicyName { get => this._passwordResetPolicyName; set => this._passwordResetPolicyName = value; } + + /// Backing field for property. + private string _profileEditingPolicyName; + + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProfileEditingPolicyName { get => this._profileEditingPolicyName; set => this._profileEditingPolicyName = value; } + + /// Backing field for property. + private string _signinPolicyName; + + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SigninPolicyName { get => this._signinPolicyName; set => this._signinPolicyName = value; } + + /// Backing field for property. + private string _signinTenant; + + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SigninTenant { get => this._signinTenant; set => this._signinTenant = value; } + + /// Backing field for property. + private string _signupPolicyName; + + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SignupPolicyName { get => this._signupPolicyName; set => this._signupPolicyName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? _type; + + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public IdentityProviderBaseParameters() + { + + } + } + /// Identity Provider Base Parameter Properties. + public partial interface IIdentityProviderBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Allowed Tenants when configuring Azure Active Directory login.", + SerializedName = @"allowedTenants", + PossibleTypes = new [] { typeof(string) })] + string[] AllowedTenant { get; set; } + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OpenID Connect discovery endpoint hostname for AAD or AAD B2C.", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + string Authority { get; set; } + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider.", + SerializedName = @"clientLibrary", + PossibleTypes = new [] { typeof(string) })] + string ClientLibrary { get; set; } + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password Reset Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"passwordResetPolicyName", + PossibleTypes = new [] { typeof(string) })] + string PasswordResetPolicyName { get; set; } + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"profileEditingPolicyName", + PossibleTypes = new [] { typeof(string) })] + string ProfileEditingPolicyName { get; set; } + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Signin Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"signinPolicyName", + PossibleTypes = new [] { typeof(string) })] + string SigninPolicyName { get; set; } + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The TenantId to use instead of Common when logging into Active Directory", + SerializedName = @"signinTenant", + PossibleTypes = new [] { typeof(string) })] + string SigninTenant { get; set; } + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Signup Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"signupPolicyName", + PossibleTypes = new [] { typeof(string) })] + string SignupPolicyName { get; set; } + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity Provider Type identifier.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? Type { get; set; } + + } + /// Identity Provider Base Parameter Properties. + internal partial interface IIdentityProviderBaseParametersInternal + + { + /// List of Allowed Tenants when configuring Azure Active Directory login. + string[] AllowedTenant { get; set; } + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + string Authority { get; set; } + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + string ClientLibrary { get; set; } + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + string PasswordResetPolicyName { get; set; } + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + string ProfileEditingPolicyName { get; set; } + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + string SigninPolicyName { get; set; } + /// The TenantId to use instead of Common when logging into Active Directory + string SigninTenant { get; set; } + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + string SignupPolicyName { get; set; } + /// Identity Provider Type identifier. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderBaseParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderBaseParameters.json.cs new file mode 100644 index 000000000000..4e8a2e2a4fff --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderBaseParameters.json.cs @@ -0,0 +1,132 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity Provider Base Parameter Properties. + public partial class IdentityProviderBaseParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IdentityProviderBaseParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityProviderBaseParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_signinTenant = If( json?.PropertyT("signinTenant"), out var __jsonSigninTenant) ? (string)__jsonSigninTenant : (string)SigninTenant;} + {_allowedTenant = If( json?.PropertyT("allowedTenants"), out var __jsonAllowedTenants) ? If( __jsonAllowedTenants as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AllowedTenant;} + {_authority = If( json?.PropertyT("authority"), out var __jsonAuthority) ? (string)__jsonAuthority : (string)Authority;} + {_signupPolicyName = If( json?.PropertyT("signupPolicyName"), out var __jsonSignupPolicyName) ? (string)__jsonSignupPolicyName : (string)SignupPolicyName;} + {_signinPolicyName = If( json?.PropertyT("signinPolicyName"), out var __jsonSigninPolicyName) ? (string)__jsonSigninPolicyName : (string)SigninPolicyName;} + {_profileEditingPolicyName = If( json?.PropertyT("profileEditingPolicyName"), out var __jsonProfileEditingPolicyName) ? (string)__jsonProfileEditingPolicyName : (string)ProfileEditingPolicyName;} + {_passwordResetPolicyName = If( json?.PropertyT("passwordResetPolicyName"), out var __jsonPasswordResetPolicyName) ? (string)__jsonPasswordResetPolicyName : (string)PasswordResetPolicyName;} + {_clientLibrary = If( json?.PropertyT("clientLibrary"), out var __jsonClientLibrary) ? (string)__jsonClientLibrary : (string)ClientLibrary;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._signinTenant)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._signinTenant.ToString()) : null, "signinTenant" ,container.Add ); + if (null != this._allowedTenant) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._allowedTenant ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("allowedTenants",__w); + } + AddIf( null != (((object)this._authority)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._authority.ToString()) : null, "authority" ,container.Add ); + AddIf( null != (((object)this._signupPolicyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._signupPolicyName.ToString()) : null, "signupPolicyName" ,container.Add ); + AddIf( null != (((object)this._signinPolicyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._signinPolicyName.ToString()) : null, "signinPolicyName" ,container.Add ); + AddIf( null != (((object)this._profileEditingPolicyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._profileEditingPolicyName.ToString()) : null, "profileEditingPolicyName" ,container.Add ); + AddIf( null != (((object)this._passwordResetPolicyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._passwordResetPolicyName.ToString()) : null, "passwordResetPolicyName" ,container.Add ); + AddIf( null != (((object)this._clientLibrary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientLibrary.ToString()) : null, "clientLibrary" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContract.cs new file mode 100644 index 000000000000..1ad01ef4457e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContract.cs @@ -0,0 +1,296 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity Provider details. + public partial class IdentityProviderContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] AllowedTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).AllowedTenant = value ?? null /* arrayOf */; } + + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Authority { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Authority = value ?? null; } + + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractPropertiesInternal)Property).ClientId = value ?? null; } + + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientLibrary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ClientLibrary = value ?? null; } + + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractPropertiesInternal)Property).ClientSecret = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PasswordResetPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).PasswordResetPolicyName = value ?? null; } + + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProfileEditingPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ProfileEditingPolicyName = value ?? null; } + + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? PropertiesType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractProperties _property; + + /// Identity Provider contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderContractProperties()); set => this._property = value; } + + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SigninPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninPolicyName = value ?? null; } + + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SigninTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninTenant = value ?? null; } + + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SignupPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SignupPolicyName = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public IdentityProviderContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Identity Provider details. + public partial interface IIdentityProviderContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Allowed Tenants when configuring Azure Active Directory login.", + SerializedName = @"allowedTenants", + PossibleTypes = new [] { typeof(string) })] + string[] AllowedTenant { get; set; } + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OpenID Connect discovery endpoint hostname for AAD or AAD B2C.", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + string Authority { get; set; } + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider.", + SerializedName = @"clientLibrary", + PossibleTypes = new [] { typeof(string) })] + string ClientLibrary { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password Reset Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"passwordResetPolicyName", + PossibleTypes = new [] { typeof(string) })] + string PasswordResetPolicyName { get; set; } + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"profileEditingPolicyName", + PossibleTypes = new [] { typeof(string) })] + string ProfileEditingPolicyName { get; set; } + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity Provider Type identifier.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? PropertiesType { get; set; } + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Signin Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"signinPolicyName", + PossibleTypes = new [] { typeof(string) })] + string SigninPolicyName { get; set; } + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The TenantId to use instead of Common when logging into Active Directory", + SerializedName = @"signinTenant", + PossibleTypes = new [] { typeof(string) })] + string SigninTenant { get; set; } + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Signup Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"signupPolicyName", + PossibleTypes = new [] { typeof(string) })] + string SignupPolicyName { get; set; } + + } + /// Identity Provider details. + internal partial interface IIdentityProviderContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// List of Allowed Tenants when configuring Azure Active Directory login. + string[] AllowedTenant { get; set; } + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + string Authority { get; set; } + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + string ClientId { get; set; } + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + string ClientLibrary { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string ClientSecret { get; set; } + + string ETag { get; set; } + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + string PasswordResetPolicyName { get; set; } + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + string ProfileEditingPolicyName { get; set; } + /// Identity Provider Type identifier. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? PropertiesType { get; set; } + /// Identity Provider contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractProperties Property { get; set; } + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + string SigninPolicyName { get; set; } + /// The TenantId to use instead of Common when logging into Active Directory + string SigninTenant { get; set; } + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + string SignupPolicyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContract.json.cs new file mode 100644 index 000000000000..deade55d27cf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity Provider details. + public partial class IdentityProviderContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IdentityProviderContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityProviderContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContractProperties.cs new file mode 100644 index 000000000000..1cb60c2650bf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContractProperties.cs @@ -0,0 +1,151 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used + /// to enable access to the API Management service developer portal for all users. + /// + public partial class IdentityProviderContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParameters __identityProviderBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderBaseParameters(); + + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] AllowedTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).AllowedTenant = value ?? null /* arrayOf */; } + + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Authority { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Authority = value ?? null; } + + /// Backing field for property. + private string _clientId; + + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ClientLibrary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ClientLibrary = value ?? null; } + + /// Backing field for property. + private string _clientSecret; + + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientSecret { get => this._clientSecret; set => this._clientSecret = value; } + + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string PasswordResetPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).PasswordResetPolicyName = value ?? null; } + + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProfileEditingPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ProfileEditingPolicyName = value ?? null; } + + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SigninPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninPolicyName = value ?? null; } + + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SigninTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninTenant = value ?? null; } + + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SignupPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SignupPolicyName = value ?? null; } + + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType)""); } + + /// Creates an new instance. + public IdentityProviderContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__identityProviderBaseParameters), __identityProviderBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__identityProviderBaseParameters), __identityProviderBaseParameters); + } + } + /// The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used + /// to enable access to the API Management service developer portal for all users. + public partial interface IIdentityProviderContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParameters + { + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + + } + /// The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used + /// to enable access to the API Management service developer portal for all users. + internal partial interface IIdentityProviderContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal + { + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + string ClientId { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string ClientSecret { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContractProperties.json.cs new file mode 100644 index 000000000000..8c92d72a9e13 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderContractProperties.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used + /// to enable access to the API Management service developer portal for all users. + /// + public partial class IdentityProviderContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IdentityProviderContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityProviderContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __identityProviderBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderBaseParameters(json); + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __identityProviderBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AddIf( null != (((object)this._clientSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientSecret.ToString()) : null, "clientSecret" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContract.cs new file mode 100644 index 000000000000..6fcf60f87e47 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContract.cs @@ -0,0 +1,270 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity Provider details. + public partial class IdentityProviderCreateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] AllowedTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).AllowedTenant = value ?? null /* arrayOf */; } + + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Authority { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Authority = value ?? null; } + + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractPropertiesInternal)Property).ClientId = value ?? null; } + + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientLibrary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ClientLibrary = value ?? null; } + + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractPropertiesInternal)Property).ClientSecret = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderCreateContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PasswordResetPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).PasswordResetPolicyName = value ?? null; } + + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProfileEditingPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ProfileEditingPolicyName = value ?? null; } + + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? PropertiesType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractProperties _property; + + /// Identity Provider contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderCreateContractProperties()); set => this._property = value; } + + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SigninPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninPolicyName = value ?? null; } + + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SigninTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninTenant = value ?? null; } + + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SignupPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SignupPolicyName = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public IdentityProviderCreateContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Identity Provider details. + public partial interface IIdentityProviderCreateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Allowed Tenants when configuring Azure Active Directory login.", + SerializedName = @"allowedTenants", + PossibleTypes = new [] { typeof(string) })] + string[] AllowedTenant { get; set; } + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OpenID Connect discovery endpoint hostname for AAD or AAD B2C.", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + string Authority { get; set; } + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider.", + SerializedName = @"clientLibrary", + PossibleTypes = new [] { typeof(string) })] + string ClientLibrary { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password Reset Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"passwordResetPolicyName", + PossibleTypes = new [] { typeof(string) })] + string PasswordResetPolicyName { get; set; } + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"profileEditingPolicyName", + PossibleTypes = new [] { typeof(string) })] + string ProfileEditingPolicyName { get; set; } + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity Provider Type identifier.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? PropertiesType { get; set; } + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Signin Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"signinPolicyName", + PossibleTypes = new [] { typeof(string) })] + string SigninPolicyName { get; set; } + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The TenantId to use instead of Common when logging into Active Directory", + SerializedName = @"signinTenant", + PossibleTypes = new [] { typeof(string) })] + string SigninTenant { get; set; } + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Signup Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"signupPolicyName", + PossibleTypes = new [] { typeof(string) })] + string SignupPolicyName { get; set; } + + } + /// Identity Provider details. + internal partial interface IIdentityProviderCreateContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// List of Allowed Tenants when configuring Azure Active Directory login. + string[] AllowedTenant { get; set; } + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + string Authority { get; set; } + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + string ClientId { get; set; } + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + string ClientLibrary { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string ClientSecret { get; set; } + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + string PasswordResetPolicyName { get; set; } + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + string ProfileEditingPolicyName { get; set; } + /// Identity Provider Type identifier. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? PropertiesType { get; set; } + /// Identity Provider contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractProperties Property { get; set; } + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + string SigninPolicyName { get; set; } + /// The TenantId to use instead of Common when logging into Active Directory + string SigninTenant { get; set; } + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + string SignupPolicyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContract.json.cs new file mode 100644 index 000000000000..16263389a040 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Identity Provider details. + public partial class IdentityProviderCreateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IdentityProviderCreateContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityProviderCreateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderCreateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContractProperties.cs new file mode 100644 index 000000000000..a99eef3fbb6e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContractProperties.cs @@ -0,0 +1,153 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used + /// to enable access to the API Management service developer portal for all users. + /// + public partial class IdentityProviderCreateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParameters __identityProviderBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderBaseParameters(); + + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] AllowedTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).AllowedTenant = value ?? null /* arrayOf */; } + + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Authority { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Authority = value ?? null; } + + /// Backing field for property. + private string _clientId; + + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ClientLibrary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ClientLibrary = value ?? null; } + + /// Backing field for property. + private string _clientSecret; + + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientSecret { get => this._clientSecret; set => this._clientSecret = value; } + + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string PasswordResetPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).PasswordResetPolicyName = value ?? null; } + + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProfileEditingPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ProfileEditingPolicyName = value ?? null; } + + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SigninPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninPolicyName = value ?? null; } + + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SigninTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninTenant = value ?? null; } + + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SignupPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SignupPolicyName = value ?? null; } + + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType)""); } + + /// + /// Creates an new instance. + /// + public IdentityProviderCreateContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__identityProviderBaseParameters), __identityProviderBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__identityProviderBaseParameters), __identityProviderBaseParameters); + } + } + /// The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used + /// to enable access to the API Management service developer portal for all users. + public partial interface IIdentityProviderCreateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParameters + { + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + + } + /// The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used + /// to enable access to the API Management service developer portal for all users. + internal partial interface IIdentityProviderCreateContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal + { + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + string ClientId { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string ClientSecret { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContractProperties.json.cs new file mode 100644 index 000000000000..98e552b3f398 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderCreateContractProperties.json.cs @@ -0,0 +1,117 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used + /// to enable access to the API Management service developer portal for all users. + /// + public partial class IdentityProviderCreateContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderCreateContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IdentityProviderCreateContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityProviderCreateContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __identityProviderBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderBaseParameters(json); + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __identityProviderBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AddIf( null != (((object)this._clientSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientSecret.ToString()) : null, "clientSecret" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderList.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderList.cs new file mode 100644 index 000000000000..d00aa3bd6cc9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderList.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// List of all the Identity Providers configured on the service instance. + public partial class IdentityProviderList : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderList, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderListInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContract[] _value; + + /// Identity Provider configuration values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public IdentityProviderList() + { + + } + } + /// List of all the Identity Providers configured on the service instance. + public partial interface IIdentityProviderList : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Identity Provider configuration values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity Provider configuration values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContract[] Value { get; set; } + + } + /// List of all the Identity Providers configured on the service instance. + internal partial interface IIdentityProviderListInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Identity Provider configuration values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderList.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderList.json.cs new file mode 100644 index 000000000000..509a74bd3ffa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderList.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// List of all the Identity Providers configured on the service instance. + public partial class IdentityProviderList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IdentityProviderList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityProviderList(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateParameters.cs new file mode 100644 index 000000000000..e04069613cfb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateParameters.cs @@ -0,0 +1,224 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to update Identity Provider + public partial class IdentityProviderUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateParametersInternal + { + + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] AllowedTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).AllowedTenant = value ?? null /* arrayOf */; } + + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Authority { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Authority = value ?? null; } + + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdatePropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdatePropertiesInternal)Property).ClientId = value ?? null; } + + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientLibrary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ClientLibrary = value ?? null; } + + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdatePropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdatePropertiesInternal)Property).ClientSecret = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderUpdateProperties()); set { {_property = value;} } } + + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PasswordResetPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).PasswordResetPolicyName = value ?? null; } + + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProfileEditingPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).ProfileEditingPolicyName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateProperties _property; + + /// Identity Provider update properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderUpdateProperties()); set => this._property = value; } + + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SigninPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninPolicyName = value ?? null; } + + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SigninTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SigninTenant = value ?? null; } + + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SignupPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).SignupPolicyName = value ?? null; } + + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType)""); } + + /// Creates an new instance. + public IdentityProviderUpdateParameters() + { + + } + } + /// Parameters supplied to update Identity Provider + public partial interface IIdentityProviderUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Allowed Tenants when configuring Azure Active Directory login.", + SerializedName = @"allowedTenants", + PossibleTypes = new [] { typeof(string) })] + string[] AllowedTenant { get; set; } + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OpenID Connect discovery endpoint hostname for AAD or AAD B2C.", + SerializedName = @"authority", + PossibleTypes = new [] { typeof(string) })] + string Authority { get; set; } + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider.", + SerializedName = @"clientLibrary", + PossibleTypes = new [] { typeof(string) })] + string ClientLibrary { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Password Reset Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"passwordResetPolicyName", + PossibleTypes = new [] { typeof(string) })] + string PasswordResetPolicyName { get; set; } + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"profileEditingPolicyName", + PossibleTypes = new [] { typeof(string) })] + string ProfileEditingPolicyName { get; set; } + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Signin Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"signinPolicyName", + PossibleTypes = new [] { typeof(string) })] + string SigninPolicyName { get; set; } + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The TenantId to use instead of Common when logging into Active Directory", + SerializedName = @"signinTenant", + PossibleTypes = new [] { typeof(string) })] + string SigninTenant { get; set; } + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Signup Policy Name. Only applies to AAD B2C Identity Provider.", + SerializedName = @"signupPolicyName", + PossibleTypes = new [] { typeof(string) })] + string SignupPolicyName { get; set; } + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity Provider Type identifier.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? Type { get; set; } + + } + /// Parameters supplied to update Identity Provider + internal partial interface IIdentityProviderUpdateParametersInternal + + { + /// List of Allowed Tenants when configuring Azure Active Directory login. + string[] AllowedTenant { get; set; } + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + string Authority { get; set; } + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + string ClientId { get; set; } + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + string ClientLibrary { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. + /// + string ClientSecret { get; set; } + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + string PasswordResetPolicyName { get; set; } + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + string ProfileEditingPolicyName { get; set; } + /// Identity Provider update properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateProperties Property { get; set; } + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + string SigninPolicyName { get; set; } + /// The TenantId to use instead of Common when logging into Active Directory + string SigninTenant { get; set; } + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + string SignupPolicyName { get; set; } + /// Identity Provider Type identifier. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateParameters.json.cs new file mode 100644 index 000000000000..ff01ac9cefa7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to update Identity Provider + public partial class IdentityProviderUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IdentityProviderUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityProviderUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderUpdateProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateProperties.cs new file mode 100644 index 000000000000..9227639d57cb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateProperties.cs @@ -0,0 +1,143 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Identity Provider operation. + public partial class IdentityProviderUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdatePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParameters __identityProviderBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderBaseParameters(); + + /// List of Allowed Tenants when configuring Azure Active Directory login. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] AllowedTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).AllowedTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).AllowedTenant = value ?? null /* arrayOf */; } + + /// OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Authority { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Authority; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Authority = value ?? null; } + + /// Backing field for property. + private string _clientId; + + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// + /// The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ClientLibrary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ClientLibrary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ClientLibrary = value ?? null; } + + /// Backing field for property. + private string _clientSecret; + + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientSecret { get => this._clientSecret; set => this._clientSecret = value; } + + /// Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string PasswordResetPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).PasswordResetPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).PasswordResetPolicyName = value ?? null; } + + /// Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ProfileEditingPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ProfileEditingPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).ProfileEditingPolicyName = value ?? null; } + + /// Signin Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SigninPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninPolicyName = value ?? null; } + + /// The TenantId to use instead of Common when logging into Active Directory + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SigninTenant { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninTenant; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SigninTenant = value ?? null; } + + /// Signup Policy Name. Only applies to AAD B2C Identity Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SignupPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SignupPolicyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).SignupPolicyName = value ?? null; } + + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal)__identityProviderBaseParameters).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType)""); } + + /// Creates an new instance. + public IdentityProviderUpdateProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__identityProviderBaseParameters), __identityProviderBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__identityProviderBaseParameters), __identityProviderBaseParameters); + } + } + /// Parameters supplied to the Update Identity Provider operation. + public partial interface IIdentityProviderUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParameters + { + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + + } + /// Parameters supplied to the Update Identity Provider operation. + internal partial interface IIdentityProviderUpdatePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderBaseParametersInternal + { + /// + /// Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + string ClientId { get; set; } + /// + /// Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. + /// + string ClientSecret { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateProperties.json.cs new file mode 100644 index 000000000000..449abe0ef00d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IdentityProviderUpdateProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Identity Provider operation. + public partial class IdentityProviderUpdateProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIdentityProviderUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IdentityProviderUpdateProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityProviderUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __identityProviderBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IdentityProviderBaseParameters(json); + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __identityProviderBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AddIf( null != (((object)this._clientSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientSecret.ToString()) : null, "clientSecret" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentCollection.cs new file mode 100644 index 000000000000..1afcfc3f0288 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Issue Attachment list representation. + public partial class IssueAttachmentCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract[] _value; + + /// Issue Attachment values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract[] Value { get => this._value; } + + /// Creates an new instance. + public IssueAttachmentCollection() + { + + } + } + /// Paged Issue Attachment list representation. + public partial interface IIssueAttachmentCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Issue Attachment values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Issue Attachment values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract[] Value { get; } + + } + /// Paged Issue Attachment list representation. + internal partial interface IIssueAttachmentCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Issue Attachment values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentCollection.json.cs new file mode 100644 index 000000000000..9506b5cf0f1d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Issue Attachment list representation. + public partial class IssueAttachmentCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueAttachmentCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueAttachmentCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueAttachmentContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContract.cs new file mode 100644 index 000000000000..929334a248e4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContract.cs @@ -0,0 +1,166 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Attachment Contract details. + public partial class IssueAttachmentContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// An HTTP link or Base64-encoded binary data. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Content { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractPropertiesInternal)Property).Content; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractPropertiesInternal)Property).Content = value ?? null; } + + /// + /// Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the + /// 'content' property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContentFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractPropertiesInternal)Property).ContentFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractPropertiesInternal)Property).ContentFormat = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueAttachmentContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractProperties _property; + + /// Properties of the Issue Attachment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueAttachmentContractProperties()); set => this._property = value; } + + /// Filename by which the binary data will be saved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractPropertiesInternal)Property).Title = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public IssueAttachmentContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Issue Attachment Contract details. + public partial interface IIssueAttachmentContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// An HTTP link or Base64-encoded binary data. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An HTTP link or Base64-encoded binary data.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(string) })] + string Content { get; set; } + /// + /// Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the + /// 'content' property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the 'content' property.", + SerializedName = @"contentFormat", + PossibleTypes = new [] { typeof(string) })] + string ContentFormat { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Filename by which the binary data will be saved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Filename by which the binary data will be saved.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Issue Attachment Contract details. + internal partial interface IIssueAttachmentContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// An HTTP link or Base64-encoded binary data. + string Content { get; set; } + /// + /// Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the + /// 'content' property. + /// + string ContentFormat { get; set; } + + string ETag { get; set; } + /// Properties of the Issue Attachment. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractProperties Property { get; set; } + /// Filename by which the binary data will be saved. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContract.json.cs new file mode 100644 index 000000000000..4b69140131d2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Attachment Contract details. + public partial class IssueAttachmentContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueAttachmentContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueAttachmentContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueAttachmentContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContractProperties.cs new file mode 100644 index 000000000000..bceacb55f8d0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContractProperties.cs @@ -0,0 +1,94 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Attachment contract Properties. + public partial class IssueAttachmentContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractPropertiesInternal + { + + /// Backing field for property. + private string _content; + + /// An HTTP link or Base64-encoded binary data. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Content { get => this._content; set => this._content = value; } + + /// Backing field for property. + private string _contentFormat; + + /// + /// Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the + /// 'content' property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ContentFormat { get => this._contentFormat; set => this._contentFormat = value; } + + /// Backing field for property. + private string _title; + + /// Filename by which the binary data will be saved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// Creates an new instance. + public IssueAttachmentContractProperties() + { + + } + } + /// Issue Attachment contract Properties. + public partial interface IIssueAttachmentContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// An HTTP link or Base64-encoded binary data. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"An HTTP link or Base64-encoded binary data.", + SerializedName = @"content", + PossibleTypes = new [] { typeof(string) })] + string Content { get; set; } + /// + /// Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the + /// 'content' property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the 'content' property.", + SerializedName = @"contentFormat", + PossibleTypes = new [] { typeof(string) })] + string ContentFormat { get; set; } + /// Filename by which the binary data will be saved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Filename by which the binary data will be saved.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Issue Attachment contract Properties. + internal partial interface IIssueAttachmentContractPropertiesInternal + + { + /// An HTTP link or Base64-encoded binary data. + string Content { get; set; } + /// + /// Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the + /// 'content' property. + /// + string ContentFormat { get; set; } + /// Filename by which the binary data will be saved. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContractProperties.json.cs new file mode 100644 index 000000000000..b3bb8880a153 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueAttachmentContractProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Attachment contract Properties. + public partial class IssueAttachmentContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueAttachmentContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueAttachmentContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueAttachmentContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_contentFormat = If( json?.PropertyT("contentFormat"), out var __jsonContentFormat) ? (string)__jsonContentFormat : (string)ContentFormat;} + {_content = If( json?.PropertyT("content"), out var __jsonContent) ? (string)__jsonContent : (string)Content;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._contentFormat)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._contentFormat.ToString()) : null, "contentFormat" ,container.Add ); + AddIf( null != (((object)this._content)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._content.ToString()) : null, "content" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCollection.cs new file mode 100644 index 000000000000..dede3186370f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Issue list representation. + public partial class IssueCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract[] _value; + + /// Issue values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract[] Value { get => this._value; } + + /// Creates an new instance. + public IssueCollection() + { + + } + } + /// Paged Issue list representation. + public partial interface IIssueCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Issue values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Issue values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract[] Value { get; } + + } + /// Paged Issue list representation. + internal partial interface IIssueCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Issue values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCollection.json.cs new file mode 100644 index 000000000000..1cb7cda70dc3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Issue list representation. + public partial class IssueCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentCollection.cs new file mode 100644 index 000000000000..ef9a58e4ca2b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Issue Comment list representation. + public partial class IssueCommentCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract[] _value; + + /// Issue Comment values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract[] Value { get => this._value; } + + /// Creates an new instance. + public IssueCommentCollection() + { + + } + } + /// Paged Issue Comment list representation. + public partial interface IIssueCommentCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Issue Comment values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Issue Comment values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract[] Value { get; } + + } + /// Paged Issue Comment list representation. + internal partial interface IIssueCommentCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Issue Comment values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentCollection.json.cs new file mode 100644 index 000000000000..994760497a82 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Issue Comment list representation. + public partial class IssueCommentCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueCommentCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueCommentCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueCommentContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContract.cs new file mode 100644 index 000000000000..11f57f6d2362 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContract.cs @@ -0,0 +1,157 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Comment Contract details. + public partial class IssueCommentContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Date and time when the comment was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractPropertiesInternal)Property).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractPropertiesInternal)Property).CreatedDate = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueCommentContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractProperties _property; + + /// Properties of the Issue Comment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueCommentContractProperties()); set => this._property = value; } + + /// Comment text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Text { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractPropertiesInternal)Property).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractPropertiesInternal)Property).Text = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// A resource identifier for the user who left the comment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractPropertiesInternal)Property).UserId = value ?? null; } + + /// Creates an new instance. + public IssueCommentContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Issue Comment Contract details. + public partial interface IIssueCommentContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Date and time when the comment was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time when the comment was created.", + SerializedName = @"createdDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDate { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Comment text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comment text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string Text { get; set; } + /// A resource identifier for the user who left the comment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the user who left the comment.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; set; } + + } + /// Issue Comment Contract details. + internal partial interface IIssueCommentContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Date and time when the comment was created. + global::System.DateTime? CreatedDate { get; set; } + + string ETag { get; set; } + /// Properties of the Issue Comment. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractProperties Property { get; set; } + /// Comment text. + string Text { get; set; } + /// A resource identifier for the user who left the comment. + string UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContract.json.cs new file mode 100644 index 000000000000..bc90d9309587 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Comment Contract details. + public partial class IssueCommentContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueCommentContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueCommentContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueCommentContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContractProperties.cs new file mode 100644 index 000000000000..c0ce68e6bbfa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContractProperties.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Comment contract Properties. + public partial class IssueCommentContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdDate; + + /// Date and time when the comment was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedDate { get => this._createdDate; set => this._createdDate = value; } + + /// Backing field for property. + private string _text; + + /// Comment text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Text { get => this._text; set => this._text = value; } + + /// Backing field for property. + private string _userId; + + /// A resource identifier for the user who left the comment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UserId { get => this._userId; set => this._userId = value; } + + /// Creates an new instance. + public IssueCommentContractProperties() + { + + } + } + /// Issue Comment contract Properties. + public partial interface IIssueCommentContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Date and time when the comment was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time when the comment was created.", + SerializedName = @"createdDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDate { get; set; } + /// Comment text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Comment text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string Text { get; set; } + /// A resource identifier for the user who left the comment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A resource identifier for the user who left the comment.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; set; } + + } + /// Issue Comment contract Properties. + internal partial interface IIssueCommentContractPropertiesInternal + + { + /// Date and time when the comment was created. + global::System.DateTime? CreatedDate { get; set; } + /// Comment text. + string Text { get; set; } + /// A resource identifier for the user who left the comment. + string UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContractProperties.json.cs new file mode 100644 index 000000000000..377151794fcd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueCommentContractProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Comment contract Properties. + public partial class IssueCommentContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueCommentContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueCommentContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueCommentContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_text = If( json?.PropertyT("text"), out var __jsonText) ? (string)__jsonText : (string)Text;} + {_createdDate = If( json?.PropertyT("createdDate"), out var __jsonCreatedDate) ? global::System.DateTime.TryParse((string)__jsonCreatedDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateValue) ? __jsonCreatedDateValue : CreatedDate : CreatedDate;} + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._text)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._text.ToString()) : null, "text" ,container.Add ); + AddIf( null != this._createdDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._createdDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdDate" ,container.Add ); + AddIf( null != (((object)this._userId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._userId.ToString()) : null, "userId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContext.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContext.cs new file mode 100644 index 000000000000..6f39671f187d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContext.cs @@ -0,0 +1,35 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A key-value pair that provides additional context on the issue. + public partial class IssueContext : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContextInternal + { + + /// Creates an new instance. + public IssueContext() + { + + } + } + /// A key-value pair that provides additional context on the issue. + public partial interface IIssueContext : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// A key-value pair that provides additional context on the issue. + internal partial interface IIssueContextInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContext.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContext.dictionary.cs new file mode 100644 index 000000000000..951edeab0646 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContext.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class IssueContext : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContext source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContext.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContext.json.cs new file mode 100644 index 000000000000..c84e831444e2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContext.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A key-value pair that provides additional context on the issue. + public partial class IssueContext + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContext FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueContext(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal IssueContext(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContract.cs new file mode 100644 index 000000000000..7b355aa8907c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContract.cs @@ -0,0 +1,199 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Contract details. + public partial class IssueContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// A resource identifier for the API the issue was created for. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).ApiId = value ?? null; } + + /// Date and time when the issue was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).CreatedDate = value ?? default(global::System.DateTime); } + + /// Text describing the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractPropertiesInternal)Property).Description = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractProperties _property; + + /// Properties of the Issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContractProperties()); set => this._property = value; } + + /// Status of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State)""); } + + /// The issue title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractPropertiesInternal)Property).Title = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// A resource identifier for the user created the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractPropertiesInternal)Property).UserId = value ?? null; } + + /// Creates an new instance. + public IssueContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Issue Contract details. + public partial interface IIssueContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// A resource identifier for the API the issue was created for. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the API the issue was created for.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + /// Date and time when the issue was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time when the issue was created.", + SerializedName = @"createdDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDate { get; set; } + /// Text describing the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Text describing the issue.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Status of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the issue.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get; set; } + /// The issue title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The issue title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + /// A resource identifier for the user created the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the user created the issue.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; set; } + + } + /// Issue Contract details. + internal partial interface IIssueContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// A resource identifier for the API the issue was created for. + string ApiId { get; set; } + /// Date and time when the issue was created. + global::System.DateTime? CreatedDate { get; set; } + /// Text describing the issue. + string Description { get; set; } + + string ETag { get; set; } + /// Properties of the Issue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractProperties Property { get; set; } + /// Status of the issue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get; set; } + /// The issue title. + string Title { get; set; } + /// A resource identifier for the user created the issue. + string UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContract.json.cs new file mode 100644 index 000000000000..516e4163833d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue Contract details. + public partial class IssueContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractBaseProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractBaseProperties.cs new file mode 100644 index 000000000000..957186e71bcc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractBaseProperties.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Base Properties. + public partial class IssueContractBaseProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBaseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal + { + + /// Backing field for property. + private string _apiId; + + /// A resource identifier for the API the issue was created for. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiId { get => this._apiId; set => this._apiId = value; } + + /// Backing field for property. + private global::System.DateTime? _createdDate; + + /// Date and time when the issue was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedDate { get => this._createdDate; set => this._createdDate = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? _state; + + /// Status of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get => this._state; set => this._state = value; } + + /// Creates an new instance. + public IssueContractBaseProperties() + { + + } + } + /// Issue contract Base Properties. + public partial interface IIssueContractBaseProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// A resource identifier for the API the issue was created for. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the API the issue was created for.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + /// Date and time when the issue was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time when the issue was created.", + SerializedName = @"createdDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDate { get; set; } + /// Status of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the issue.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get; set; } + + } + /// Issue contract Base Properties. + internal partial interface IIssueContractBasePropertiesInternal + + { + /// A resource identifier for the API the issue was created for. + string ApiId { get; set; } + /// Date and time when the issue was created. + global::System.DateTime? CreatedDate { get; set; } + /// Status of the issue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractBaseProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractBaseProperties.json.cs new file mode 100644 index 000000000000..c4eb652a8321 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractBaseProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Base Properties. + public partial class IssueContractBaseProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBaseProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBaseProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBaseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueContractBaseProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueContractBaseProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_createdDate = If( json?.PropertyT("createdDate"), out var __jsonCreatedDate) ? global::System.DateTime.TryParse((string)__jsonCreatedDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateValue) ? __jsonCreatedDateValue : CreatedDate : CreatedDate;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_apiId = If( json?.PropertyT("apiId"), out var __jsonApiId) ? (string)__jsonApiId : (string)ApiId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._createdDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._createdDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdDate" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AddIf( null != (((object)this._apiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiId.ToString()) : null, "apiId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractProperties.cs new file mode 100644 index 000000000000..4324b0270fe3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractProperties.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Properties. + public partial class IssueContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBaseProperties __issueContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContractBaseProperties(); + + /// A resource identifier for the API the issue was created for. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).ApiId = value ?? null; } + + /// Date and time when the issue was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public global::System.DateTime? CreatedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).CreatedDate = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _description; + + /// Text describing the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Status of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State)""); } + + /// Backing field for property. + private string _title; + + /// The issue title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// Backing field for property. + private string _userId; + + /// A resource identifier for the user created the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UserId { get => this._userId; set => this._userId = value; } + + /// Creates an new instance. + public IssueContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__issueContractBaseProperties), __issueContractBaseProperties); + await eventListener.AssertObjectIsValid(nameof(__issueContractBaseProperties), __issueContractBaseProperties); + } + } + /// Issue contract Properties. + public partial interface IIssueContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBaseProperties + { + /// Text describing the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Text describing the issue.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The issue title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The issue title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + /// A resource identifier for the user created the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A resource identifier for the user created the issue.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; set; } + + } + /// Issue contract Properties. + internal partial interface IIssueContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal + { + /// Text describing the issue. + string Description { get; set; } + /// The issue title. + string Title { get; set; } + /// A resource identifier for the user created the issue. + string UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractProperties.json.cs new file mode 100644 index 000000000000..8230c6a7829d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueContractProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Properties. + public partial class IssueContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __issueContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContractBaseProperties(json); + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __issueContractBaseProperties?.ToJson(container, serializationMode); + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._userId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._userId.ToString()) : null, "userId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContract.cs new file mode 100644 index 000000000000..6728d0d6b889 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContract.cs @@ -0,0 +1,130 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue update Parameters. + public partial class IssueUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractInternal + { + + /// A resource identifier for the API the issue was created for. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).ApiId = value ?? null; } + + /// Date and time when the issue was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).CreatedDate = value ?? default(global::System.DateTime); } + + /// Text describing the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractPropertiesInternal)Property).Description = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueUpdateContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractProperties _property; + + /// Issue entity Update contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueUpdateContractProperties()); set => this._property = value; } + + /// Status of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State)""); } + + /// The issue title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractPropertiesInternal)Property).Title = value ?? null; } + + /// A resource identifier for the user created the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractPropertiesInternal)Property).UserId = value ?? null; } + + /// Creates an new instance. + public IssueUpdateContract() + { + + } + } + /// Issue update Parameters. + public partial interface IIssueUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// A resource identifier for the API the issue was created for. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the API the issue was created for.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + /// Date and time when the issue was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date and time when the issue was created.", + SerializedName = @"createdDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDate { get; set; } + /// Text describing the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Text describing the issue.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Status of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the issue.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get; set; } + /// The issue title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The issue title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + /// A resource identifier for the user created the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the user created the issue.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; set; } + + } + /// Issue update Parameters. + internal partial interface IIssueUpdateContractInternal + + { + /// A resource identifier for the API the issue was created for. + string ApiId { get; set; } + /// Date and time when the issue was created. + global::System.DateTime? CreatedDate { get; set; } + /// Text describing the issue. + string Description { get; set; } + /// Issue entity Update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractProperties Property { get; set; } + /// Status of the issue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get; set; } + /// The issue title. + string Title { get; set; } + /// A resource identifier for the user created the issue. + string UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContract.json.cs new file mode 100644 index 000000000000..6e4173a10fd6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue update Parameters. + public partial class IssueUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueUpdateContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueUpdateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContractProperties.cs new file mode 100644 index 000000000000..875f05b86802 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContractProperties.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Update Properties. + public partial class IssueUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBaseProperties __issueContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContractBaseProperties(); + + /// A resource identifier for the API the issue was created for. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ApiId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).ApiId = value ?? null; } + + /// Date and time when the issue was created. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public global::System.DateTime? CreatedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).CreatedDate = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _description; + + /// Text describing the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Status of the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal)__issueContractBaseProperties).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State)""); } + + /// Backing field for property. + private string _title; + + /// The issue title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// Backing field for property. + private string _userId; + + /// A resource identifier for the user created the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UserId { get => this._userId; set => this._userId = value; } + + /// Creates an new instance. + public IssueUpdateContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__issueContractBaseProperties), __issueContractBaseProperties); + await eventListener.AssertObjectIsValid(nameof(__issueContractBaseProperties), __issueContractBaseProperties); + } + } + /// Issue contract Update Properties. + public partial interface IIssueUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBaseProperties + { + /// Text describing the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Text describing the issue.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The issue title. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The issue title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + /// A resource identifier for the user created the issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier for the user created the issue.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; set; } + + } + /// Issue contract Update Properties. + internal partial interface IIssueUpdateContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueContractBasePropertiesInternal + { + /// Text describing the issue. + string Description { get; set; } + /// The issue title. + string Title { get; set; } + /// A resource identifier for the user created the issue. + string UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContractProperties.json.cs new file mode 100644 index 000000000000..6e1e19bbadf3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/IssueUpdateContractProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Update Properties. + public partial class IssueUpdateContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IIssueUpdateContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IssueUpdateContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IssueUpdateContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __issueContractBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IssueContractBaseProperties(json); + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __issueContractBaseProperties?.ToJson(container, serializationMode); + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._userId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._userId.ToString()) : null, "userId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractCreateProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractCreateProperties.cs new file mode 100644 index 000000000000..fd46732dbeca --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractCreateProperties.cs @@ -0,0 +1,83 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Create keyVault contract details. + public partial class KeyVaultContractCreateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal + { + + /// Backing field for property. + private string _identityClientId; + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string IdentityClientId { get => this._identityClientId; set => this._identityClientId = value; } + + /// Backing field for property. + private string _secretIdentifier; + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SecretIdentifier { get => this._secretIdentifier; set => this._secretIdentifier = value; } + + /// Creates an new instance. + public KeyVaultContractCreateProperties() + { + + } + } + /// Create keyVault contract details. + public partial interface IKeyVaultContractCreateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string IdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string SecretIdentifier { get; set; } + + } + /// Create keyVault contract details. + internal partial interface IKeyVaultContractCreatePropertiesInternal + + { + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string IdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string SecretIdentifier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractCreateProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractCreateProperties.json.cs new file mode 100644 index 000000000000..67441a755240 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractCreateProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Create keyVault contract details. + public partial class KeyVaultContractCreateProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new KeyVaultContractCreateProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal KeyVaultContractCreateProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_secretIdentifier = If( json?.PropertyT("secretIdentifier"), out var __jsonSecretIdentifier) ? (string)__jsonSecretIdentifier : (string)SecretIdentifier;} + {_identityClientId = If( json?.PropertyT("identityClientId"), out var __jsonIdentityClientId) ? (string)__jsonIdentityClientId : (string)IdentityClientId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._secretIdentifier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._secretIdentifier.ToString()) : null, "secretIdentifier" ,container.Add ); + AddIf( null != (((object)this._identityClientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._identityClientId.ToString()) : null, "identityClientId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractProperties.cs new file mode 100644 index 000000000000..25d9ecffa91a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractProperties.cs @@ -0,0 +1,130 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// KeyVault contract details. + public partial class KeyVaultContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties __keyVaultContractCreateProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties(); + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string IdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)__keyVaultContractCreateProperties).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)__keyVaultContractCreateProperties).IdentityClientId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties _lastStatus; + + /// Last time sync and refresh status of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties LastStatus { get => (this._lastStatus = this._lastStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultLastAccessStatusContractProperties()); set => this._lastStatus = value; } + + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractPropertiesInternal)LastStatus).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractPropertiesInternal)LastStatus).Code = value ?? null; } + + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractPropertiesInternal)LastStatus).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractPropertiesInternal)LastStatus).Message = value ?? null; } + + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? LastStatusTimeStampUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractPropertiesInternal)LastStatus).TimeStampUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractPropertiesInternal)LastStatus).TimeStampUtc = value ?? default(global::System.DateTime); } + + /// Internal Acessors for LastStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal.LastStatus { get => (this._lastStatus = this._lastStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultLastAccessStatusContractProperties()); set { {_lastStatus = value;} } } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string SecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)__keyVaultContractCreateProperties).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)__keyVaultContractCreateProperties).SecretIdentifier = value ?? null; } + + /// Creates an new instance. + public KeyVaultContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__keyVaultContractCreateProperties), __keyVaultContractCreateProperties); + await eventListener.AssertObjectIsValid(nameof(__keyVaultContractCreateProperties), __keyVaultContractCreateProperties); + } + } + /// KeyVault contract details. + public partial interface IKeyVaultContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties + { + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last status code for sync and refresh of secret from key vault.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string LastStatusCode { get; set; } + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Details of the error else empty.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string LastStatusMessage { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"timeStampUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastStatusTimeStampUtc { get; set; } + + } + /// KeyVault contract details. + internal partial interface IKeyVaultContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal + { + /// Last time sync and refresh status of secret from key vault. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties LastStatus { get; set; } + /// Last status code for sync and refresh of secret from key vault. + string LastStatusCode { get; set; } + /// Details of the error else empty. + string LastStatusMessage { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? LastStatusTimeStampUtc { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractProperties.json.cs new file mode 100644 index 000000000000..24f30d4cf3b5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultContractProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// KeyVault contract details. + public partial class KeyVaultContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new KeyVaultContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal KeyVaultContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __keyVaultContractCreateProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties(json); + {_lastStatus = If( json?.PropertyT("lastStatus"), out var __jsonLastStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultLastAccessStatusContractProperties.FromJson(__jsonLastStatus) : LastStatus;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __keyVaultContractCreateProperties?.ToJson(container, serializationMode); + AddIf( null != this._lastStatus ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._lastStatus.ToJson(null,serializationMode) : null, "lastStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultLastAccessStatusContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultLastAccessStatusContractProperties.cs new file mode 100644 index 000000000000..ffae30f10d41 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultLastAccessStatusContractProperties.cs @@ -0,0 +1,97 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Update Properties. + public partial class KeyVaultLastAccessStatusContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractPropertiesInternal + { + + /// Backing field for property. + private string _code; + + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private global::System.DateTime? _timeStampUtc; + + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? TimeStampUtc { get => this._timeStampUtc; set => this._timeStampUtc = value; } + + /// + /// Creates an new instance. + /// + public KeyVaultLastAccessStatusContractProperties() + { + + } + } + /// Issue contract Update Properties. + public partial interface IKeyVaultLastAccessStatusContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last status code for sync and refresh of secret from key vault.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Details of the error else empty.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"timeStampUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimeStampUtc { get; set; } + + } + /// Issue contract Update Properties. + internal partial interface IKeyVaultLastAccessStatusContractPropertiesInternal + + { + /// Last status code for sync and refresh of secret from key vault. + string Code { get; set; } + /// Details of the error else empty. + string Message { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? TimeStampUtc { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultLastAccessStatusContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultLastAccessStatusContractProperties.json.cs new file mode 100644 index 000000000000..22ccdcb81676 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/KeyVaultLastAccessStatusContractProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Issue contract Update Properties. + public partial class KeyVaultLastAccessStatusContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new KeyVaultLastAccessStatusContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal KeyVaultLastAccessStatusContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_timeStampUtc = If( json?.PropertyT("timeStampUtc"), out var __jsonTimeStampUtc) ? global::System.DateTime.TryParse((string)__jsonTimeStampUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimeStampUtcValue) ? __jsonTimeStampUtcValue : TimeStampUtc : TimeStampUtc;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AddIf( null != this._timeStampUtc ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._timeStampUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "timeStampUtc" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerCollection.cs new file mode 100644 index 000000000000..860024799a3e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Logger list representation. + public partial class LoggerCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract[] _value; + + /// Logger values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public LoggerCollection() + { + + } + } + /// Paged Logger list representation. + public partial interface ILoggerCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Logger values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract[] Value { get; set; } + + } + /// Paged Logger list representation. + internal partial interface ILoggerCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Logger values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerCollection.json.cs new file mode 100644 index 000000000000..aa0525b8c45b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Logger list representation. + public partial class LoggerCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new LoggerCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal LoggerCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContract.cs new file mode 100644 index 000000000000..0a8cf401c455 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContract.cs @@ -0,0 +1,207 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Logger details. + public partial class LoggerContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// The name and SendRule connection string of the event hub for azureEventHub logger. + /// Instrumentation key for applicationInsights logger. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal)Property).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal)Property).Credentials = value ?? null /* model class */; } + + /// Logger description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal)Property).Description = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsBuffered { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal)Property).IsBuffered; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal)Property).IsBuffered = value ?? default(bool); } + + /// Logger type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType? LoggerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal)Property).LoggerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal)Property).LoggerType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType)""); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractProperties _property; + + /// Logger entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContractProperties()); set => this._property = value; } + + /// + /// Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal)Property).ResourceId = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public LoggerContract() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Logger details. + public partial interface ILoggerContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// The name and SendRule connection string of the event hub for azureEventHub logger. + /// Instrumentation key for applicationInsights logger. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name and SendRule connection string of the event hub for azureEventHub logger. + Instrumentation key for applicationInsights logger.", + SerializedName = @"credentials", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials Credentials { get; set; } + /// Logger description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether records are buffered in the logger before publishing. Default is assumed to be true.", + SerializedName = @"isBuffered", + PossibleTypes = new [] { typeof(bool) })] + bool? IsBuffered { get; set; } + /// Logger type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger type.", + SerializedName = @"loggerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType? LoggerType { get; set; } + /// + /// Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Logger details. + internal partial interface ILoggerContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// The name and SendRule connection string of the event hub for azureEventHub logger. + /// Instrumentation key for applicationInsights logger. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials Credentials { get; set; } + /// Logger description. + string Description { get; set; } + + string ETag { get; set; } + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + bool? IsBuffered { get; set; } + /// Logger type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType? LoggerType { get; set; } + /// Logger entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractProperties Property { get; set; } + /// + /// Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContract.json.cs new file mode 100644 index 000000000000..0332fb8fd5cc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Logger details. + public partial class LoggerContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new LoggerContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal LoggerContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractProperties.cs new file mode 100644 index 000000000000..5cc05ccffea5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractProperties.cs @@ -0,0 +1,146 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The Logger entity in API Management represents an event sink that you can use to log API Management events. Currently + /// the Logger entity supports logging API Management events to Azure Event Hubs. + /// + public partial class LoggerContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials _credentials; + + /// + /// The name and SendRule connection string of the event hub for azureEventHub logger. + /// Instrumentation key for applicationInsights logger. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials Credentials { get => (this._credentials = this._credentials ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContractPropertiesCredentials()); set => this._credentials = value; } + + /// Backing field for property. + private string _description; + + /// Logger description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private bool? _isBuffered; + + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsBuffered { get => this._isBuffered; set => this._isBuffered = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType _loggerType; + + /// Logger type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType LoggerType { get => this._loggerType; set => this._loggerType = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Creates an new instance. + public LoggerContractProperties() + { + + } + } + /// The Logger entity in API Management represents an event sink that you can use to log API Management events. Currently + /// the Logger entity supports logging API Management events to Azure Event Hubs. + public partial interface ILoggerContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The name and SendRule connection string of the event hub for azureEventHub logger. + /// Instrumentation key for applicationInsights logger. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name and SendRule connection string of the event hub for azureEventHub logger. + Instrumentation key for applicationInsights logger.", + SerializedName = @"credentials", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials Credentials { get; set; } + /// Logger description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether records are buffered in the logger before publishing. Default is assumed to be true.", + SerializedName = @"isBuffered", + PossibleTypes = new [] { typeof(bool) })] + bool? IsBuffered { get; set; } + /// Logger type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Logger type.", + SerializedName = @"loggerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType LoggerType { get; set; } + /// + /// Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// The Logger entity in API Management represents an event sink that you can use to log API Management events. Currently + /// the Logger entity supports logging API Management events to Azure Event Hubs. + internal partial interface ILoggerContractPropertiesInternal + + { + /// + /// The name and SendRule connection string of the event hub for azureEventHub logger. + /// Instrumentation key for applicationInsights logger. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials Credentials { get; set; } + /// Logger description. + string Description { get; set; } + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + bool? IsBuffered { get; set; } + /// Logger type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType LoggerType { get; set; } + /// + /// Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). + /// + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractProperties.json.cs new file mode 100644 index 000000000000..f4960ed78e18 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractProperties.json.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The Logger entity in API Management represents an event sink that you can use to log API Management events. Currently + /// the Logger entity supports logging API Management events to Azure Event Hubs. + /// + public partial class LoggerContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new LoggerContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal LoggerContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_loggerType = If( json?.PropertyT("loggerType"), out var __jsonLoggerType) ? (string)__jsonLoggerType : (string)LoggerType;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_credentials = If( json?.PropertyT("credentials"), out var __jsonCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContractPropertiesCredentials.FromJson(__jsonCredentials) : Credentials;} + {_isBuffered = If( json?.PropertyT("isBuffered"), out var __jsonIsBuffered) ? (bool?)__jsonIsBuffered : IsBuffered;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._loggerType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._loggerType.ToString()) : null, "loggerType" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != this._credentials ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._credentials.ToJson(null,serializationMode) : null, "credentials" ,container.Add ); + AddIf( null != this._isBuffered ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isBuffered) : null, "isBuffered" ,container.Add ); + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractPropertiesCredentials.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractPropertiesCredentials.cs new file mode 100644 index 000000000000..f724e4f22269 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractPropertiesCredentials.cs @@ -0,0 +1,40 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The name and SendRule connection string of the event hub for azureEventHub logger. + /// Instrumentation key for applicationInsights logger. + /// + public partial class LoggerContractPropertiesCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentialsInternal + { + + /// Creates an new instance. + public LoggerContractPropertiesCredentials() + { + + } + } + /// The name and SendRule connection string of the event hub for azureEventHub logger. + /// Instrumentation key for applicationInsights logger. + public partial interface ILoggerContractPropertiesCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// The name and SendRule connection string of the event hub for azureEventHub logger. + /// Instrumentation key for applicationInsights logger. + internal partial interface ILoggerContractPropertiesCredentialsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractPropertiesCredentials.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractPropertiesCredentials.dictionary.cs new file mode 100644 index 000000000000..8eaa776b5a4c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractPropertiesCredentials.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class LoggerContractPropertiesCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerContractPropertiesCredentials source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractPropertiesCredentials.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractPropertiesCredentials.json.cs new file mode 100644 index 000000000000..c0a472366759 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerContractPropertiesCredentials.json.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// The name and SendRule connection string of the event hub for azureEventHub logger. + /// Instrumentation key for applicationInsights logger. + /// + public partial class LoggerContractPropertiesCredentials + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerContractPropertiesCredentials FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new LoggerContractPropertiesCredentials(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal LoggerContractPropertiesCredentials(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateContract.cs new file mode 100644 index 000000000000..5b6731dc1195 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateContract.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Logger update contract. + public partial class LoggerUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateContractInternal + { + + /// Logger credentials. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials Credentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersInternal)Property).Credentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersInternal)Property).Credentials = value ?? null /* model class */; } + + /// Logger description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersInternal)Property).Description = value ?? null; } + + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsBuffered { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersInternal)Property).IsBuffered; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersInternal)Property).IsBuffered = value ?? default(bool); } + + /// Logger type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType? LoggerType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersInternal)Property).LoggerType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersInternal)Property).LoggerType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType)""); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParameters Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerUpdateParameters()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParameters _property; + + /// Logger entity update contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParameters Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerUpdateParameters()); set => this._property = value; } + + /// Creates an new instance. + public LoggerUpdateContract() + { + + } + } + /// Logger update contract. + public partial interface ILoggerUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Logger credentials. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger credentials.", + SerializedName = @"credentials", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials Credentials { get; set; } + /// Logger description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether records are buffered in the logger before publishing. Default is assumed to be true.", + SerializedName = @"isBuffered", + PossibleTypes = new [] { typeof(bool) })] + bool? IsBuffered { get; set; } + /// Logger type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger type.", + SerializedName = @"loggerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType? LoggerType { get; set; } + + } + /// Logger update contract. + internal partial interface ILoggerUpdateContractInternal + + { + /// Logger credentials. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials Credentials { get; set; } + /// Logger description. + string Description { get; set; } + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + bool? IsBuffered { get; set; } + /// Logger type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType? LoggerType { get; set; } + /// Logger entity update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParameters Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateContract.json.cs new file mode 100644 index 000000000000..0e3ab664608e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Logger update contract. + public partial class LoggerUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new LoggerUpdateContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal LoggerUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerUpdateParameters.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParameters.cs new file mode 100644 index 000000000000..4dcce41259b5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParameters.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Logger operation. + public partial class LoggerUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials _credentials; + + /// Logger credentials. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials Credentials { get => (this._credentials = this._credentials ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerUpdateParametersCredentials()); set => this._credentials = value; } + + /// Backing field for property. + private string _description; + + /// Logger description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private bool? _isBuffered; + + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsBuffered { get => this._isBuffered; set => this._isBuffered = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType? _loggerType; + + /// Logger type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType? LoggerType { get => this._loggerType; set => this._loggerType = value; } + + /// Creates an new instance. + public LoggerUpdateParameters() + { + + } + } + /// Parameters supplied to the Update Logger operation. + public partial interface ILoggerUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Logger credentials. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger credentials.", + SerializedName = @"credentials", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials Credentials { get; set; } + /// Logger description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether records are buffered in the logger before publishing. Default is assumed to be true.", + SerializedName = @"isBuffered", + PossibleTypes = new [] { typeof(bool) })] + bool? IsBuffered { get; set; } + /// Logger type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger type.", + SerializedName = @"loggerType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType? LoggerType { get; set; } + + } + /// Parameters supplied to the Update Logger operation. + internal partial interface ILoggerUpdateParametersInternal + + { + /// Logger credentials. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials Credentials { get; set; } + /// Logger description. + string Description { get; set; } + /// + /// Whether records are buffered in the logger before publishing. Default is assumed to be true. + /// + bool? IsBuffered { get; set; } + /// Logger type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType? LoggerType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParameters.json.cs new file mode 100644 index 000000000000..4ebe504eed06 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParameters.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Logger operation. + public partial class LoggerUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new LoggerUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal LoggerUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_loggerType = If( json?.PropertyT("loggerType"), out var __jsonLoggerType) ? (string)__jsonLoggerType : (string)LoggerType;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_credentials = If( json?.PropertyT("credentials"), out var __jsonCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerUpdateParametersCredentials.FromJson(__jsonCredentials) : Credentials;} + {_isBuffered = If( json?.PropertyT("isBuffered"), out var __jsonIsBuffered) ? (bool?)__jsonIsBuffered : IsBuffered;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._loggerType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._loggerType.ToString()) : null, "loggerType" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != this._credentials ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._credentials.ToJson(null,serializationMode) : null, "credentials" ,container.Add ); + AddIf( null != this._isBuffered ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isBuffered) : null, "isBuffered" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParametersCredentials.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParametersCredentials.cs new file mode 100644 index 000000000000..7df354e65d45 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParametersCredentials.cs @@ -0,0 +1,35 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Logger credentials. + public partial class LoggerUpdateParametersCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentialsInternal + { + + /// Creates an new instance. + public LoggerUpdateParametersCredentials() + { + + } + } + /// Logger credentials. + public partial interface ILoggerUpdateParametersCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// Logger credentials. + internal partial interface ILoggerUpdateParametersCredentialsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParametersCredentials.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParametersCredentials.dictionary.cs new file mode 100644 index 000000000000..add9d84fa4d0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParametersCredentials.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class LoggerUpdateParametersCredentials : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.LoggerUpdateParametersCredentials source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParametersCredentials.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParametersCredentials.json.cs new file mode 100644 index 000000000000..31a9a0c0469d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/LoggerUpdateParametersCredentials.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Logger credentials. + public partial class LoggerUpdateParametersCredentials + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ILoggerUpdateParametersCredentials FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new LoggerUpdateParametersCredentials(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal LoggerUpdateParametersCredentials(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/MigrateToStv2Contract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/MigrateToStv2Contract.cs new file mode 100644 index 000000000000..e3825c60100b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/MigrateToStv2Contract.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes an available API Management SKU. + public partial class MigrateToStv2Contract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IMigrateToStv2Contract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IMigrateToStv2ContractInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode? _mode; + + /// Mode of Migration to stv2. Default is PreserveIp. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode? Mode { get => this._mode; set => this._mode = value; } + + /// Creates an new instance. + public MigrateToStv2Contract() + { + + } + } + /// Describes an available API Management SKU. + public partial interface IMigrateToStv2Contract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Mode of Migration to stv2. Default is PreserveIp. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode of Migration to stv2. Default is PreserveIp.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode? Mode { get; set; } + + } + /// Describes an available API Management SKU. + internal partial interface IMigrateToStv2ContractInternal + + { + /// Mode of Migration to stv2. Default is PreserveIp. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode? Mode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/MigrateToStv2Contract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/MigrateToStv2Contract.json.cs new file mode 100644 index 000000000000..c9c21c900759 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/MigrateToStv2Contract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes an available API Management SKU. + public partial class MigrateToStv2Contract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IMigrateToStv2Contract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IMigrateToStv2Contract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IMigrateToStv2Contract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new MigrateToStv2Contract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal MigrateToStv2Contract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCollection.cs new file mode 100644 index 000000000000..1bfd38d66d6e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged NamedValue list representation. + public partial class NamedValueCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NamedValueCollection() + { + + } + } + /// Paged NamedValue list representation. + public partial interface INamedValueCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContract[] Value { get; set; } + + } + /// Paged NamedValue list representation. + internal partial interface INamedValueCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCollection.json.cs new file mode 100644 index 000000000000..d0304872075c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged NamedValue list representation. + public partial class NamedValueCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContract.cs new file mode 100644 index 000000000000..7044ed65be1a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContract.cs @@ -0,0 +1,352 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue details. + public partial class NamedValueContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).KeyVaultIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).KeyVaultIdentityClientId = value ?? null; } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultSecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).KeyVaultSecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).KeyVaultSecretIdentifier = value ?? null; } + + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).LastStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).LastStatusCode = value ?? null; } + + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).LastStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).LastStatusMessage = value ?? null; } + + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? LastStatusTimeStampUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).LastStatusTimeStampUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).LastStatusTimeStampUtc = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractInternal.KeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).KeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).KeyVault = value; } + + /// Internal Acessors for KeyVaultLastStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractInternal.KeyVaultLastStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).KeyVaultLastStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).KeyVaultLastStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).ProvisioningState = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractProperties _property; + + /// NamedValue entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContractProperties()); set => this._property = value; } + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).ProvisioningState; } + + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Secret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Secret = value ?? default(bool); } + + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Tag = value ?? null /* arrayOf */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal)Property).Value = value ?? null; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + if (headers.TryGetValues("location", out var __locationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader1) is string __headerLocationHeader1 ? __headerLocationHeader1 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader2)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader2) is string __headerAzureAsyncOperationHeader2 ? __headerAzureAsyncOperationHeader2 : (string)null; + } + } + + /// Creates an new instance. + public NamedValueContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// NamedValue details. + public partial interface INamedValueContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultSecretIdentifier { get; set; } + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last status code for sync and refresh of secret from key vault.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string LastStatusCode { get; set; } + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Details of the error else empty.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string LastStatusMessage { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"timeStampUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastStatusTimeStampUtc { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether the value is a secret and should be encrypted or not. Default value is false.", + SerializedName = @"secret", + PossibleTypes = new [] { typeof(bool) })] + bool? Secret { get; set; } + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional tags that when provided can be used to filter the NamedValue list.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(string) })] + string[] Tag { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// NamedValue details. + internal partial interface INamedValueContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string AzureAsyncOperation { get; set; } + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + string DisplayName { get; set; } + + string ETag { get; set; } + /// KeyVault location details of the namedValue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties KeyVault { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string KeyVaultIdentityClientId { get; set; } + /// Last time sync and refresh status of secret from key vault. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties KeyVaultLastStatus { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string KeyVaultSecretIdentifier { get; set; } + /// Last status code for sync and refresh of secret from key vault. + string LastStatusCode { get; set; } + /// Details of the error else empty. + string LastStatusMessage { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? LastStatusTimeStampUtc { get; set; } + + string Location { get; set; } + /// NamedValue entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractProperties Property { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + bool? Secret { get; set; } + /// Optional tags that when provided can be used to filter the NamedValue list. + string[] Tag { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContract.json.cs new file mode 100644 index 000000000000..00470d4c2279 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue details. + public partial class NamedValueContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContractProperties.cs new file mode 100644 index 000000000000..45849dd4c26c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContractProperties.cs @@ -0,0 +1,244 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Contract properties. + public partial class NamedValueContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParameters __namedValueEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueEntityBaseParameters(); + + /// Backing field for property. + private string _displayName; + + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties _keyVault; + + /// KeyVault location details of the namedValue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractProperties()); set => this._keyVault = value; } + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId = value ?? null; } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultSecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier = value ?? null; } + + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusCode = value ?? null; } + + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusMessage = value ?? null; } + + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? LastStatusTimeStampUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusTimeStampUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatusTimeStampUtc = value ?? default(global::System.DateTime); } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal.KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractProperties()); set { {_keyVault = value;} } } + + /// Internal Acessors for KeyVaultLastStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal.KeyVaultLastStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractPropertiesInternal)KeyVault).LastStatus = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? Secret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Secret = value ?? default(bool); } + + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Tag = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _value; + + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NamedValueContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__namedValueEntityBaseParameters), __namedValueEntityBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__namedValueEntityBaseParameters), __namedValueEntityBaseParameters); + } + } + /// NamedValue Contract properties. + public partial interface INamedValueContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParameters + { + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultSecretIdentifier { get; set; } + /// Last status code for sync and refresh of secret from key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last status code for sync and refresh of secret from key vault.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string LastStatusCode { get; set; } + /// Details of the error else empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Details of the error else empty.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string LastStatusMessage { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"timeStampUtc", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastStatusTimeStampUtc { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// NamedValue Contract properties. + internal partial interface INamedValueContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal + { + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + string DisplayName { get; set; } + /// KeyVault location details of the namedValue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractProperties KeyVault { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string KeyVaultIdentityClientId { get; set; } + /// Last time sync and refresh status of secret from key vault. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultLastAccessStatusContractProperties KeyVaultLastStatus { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string KeyVaultSecretIdentifier { get; set; } + /// Last status code for sync and refresh of secret from key vault. + string LastStatusCode { get; set; } + /// Details of the error else empty. + string LastStatusMessage { get; set; } + /// + /// Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? LastStatusTimeStampUtc { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContractProperties.json.cs new file mode 100644 index 000000000000..78e34e3cea60 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueContractProperties.json.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Contract properties. + public partial class NamedValueContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __namedValueEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueEntityBaseParameters(json); + {_keyVault = If( json?.PropertyT("keyVault"), out var __jsonKeyVault) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractProperties.FromJson(__jsonKeyVault) : KeyVault;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __namedValueEntityBaseParameters?.ToJson(container, serializationMode); + AddIf( null != this._keyVault ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._keyVault.ToJson(null,serializationMode) : null, "keyVault" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContract.cs new file mode 100644 index 000000000000..62df8a12b87f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContract.cs @@ -0,0 +1,214 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue details. + public partial class NamedValueCreateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal)Property).KeyVaultIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal)Property).KeyVaultIdentityClientId = value ?? null; } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultSecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal)Property).KeyVaultSecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal)Property).KeyVaultSecretIdentifier = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractInternal.KeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal)Property).KeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal)Property).KeyVault = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueCreateContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractProperties _property; + + /// NamedValue entity contract properties for PUT operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueCreateContractProperties()); set => this._property = value; } + + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Secret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Secret = value ?? default(bool); } + + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Tag = value ?? null /* arrayOf */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal)Property).Value = value ?? null; } + + /// Creates an new instance. + public NamedValueCreateContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// NamedValue details. + public partial interface INamedValueCreateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultSecretIdentifier { get; set; } + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether the value is a secret and should be encrypted or not. Default value is false.", + SerializedName = @"secret", + PossibleTypes = new [] { typeof(bool) })] + bool? Secret { get; set; } + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional tags that when provided can be used to filter the NamedValue list.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(string) })] + string[] Tag { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// NamedValue details. + internal partial interface INamedValueCreateContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + string DisplayName { get; set; } + /// KeyVault location details of the namedValue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties KeyVault { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string KeyVaultSecretIdentifier { get; set; } + /// NamedValue entity contract properties for PUT operation. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractProperties Property { get; set; } + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + bool? Secret { get; set; } + /// Optional tags that when provided can be used to filter the NamedValue list. + string[] Tag { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContract.json.cs new file mode 100644 index 000000000000..9b6177f6ccd5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue details. + public partial class NamedValueCreateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueCreateContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueCreateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueCreateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContractProperties.cs new file mode 100644 index 000000000000..991caf7b2f1d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContractProperties.cs @@ -0,0 +1,167 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Contract properties. + public partial class NamedValueCreateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParameters __namedValueEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueEntityBaseParameters(); + + /// Backing field for property. + private string _displayName; + + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties _keyVault; + + /// KeyVault location details of the namedValue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties()); set => this._keyVault = value; } + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId = value ?? null; } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultSecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier = value ?? null; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractPropertiesInternal.KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties()); set { {_keyVault = value;} } } + + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? Secret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Secret = value ?? default(bool); } + + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Tag = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _value; + + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NamedValueCreateContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__namedValueEntityBaseParameters), __namedValueEntityBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__namedValueEntityBaseParameters), __namedValueEntityBaseParameters); + } + } + /// NamedValue Contract properties. + public partial interface INamedValueCreateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParameters + { + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultSecretIdentifier { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// NamedValue Contract properties. + internal partial interface INamedValueCreateContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal + { + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + string DisplayName { get; set; } + /// KeyVault location details of the namedValue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties KeyVault { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string KeyVaultSecretIdentifier { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + /// + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContractProperties.json.cs new file mode 100644 index 000000000000..d144a12a9e82 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueCreateContractProperties.json.cs @@ -0,0 +1,115 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Contract properties. + public partial class NamedValueCreateContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueCreateContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueCreateContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueCreateContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __namedValueEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueEntityBaseParameters(json); + {_keyVault = If( json?.PropertyT("keyVault"), out var __jsonKeyVault) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties.FromJson(__jsonKeyVault) : KeyVault;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __namedValueEntityBaseParameters?.ToJson(container, serializationMode); + AddIf( null != this._keyVault ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._keyVault.ToJson(null,serializationMode) : null, "keyVault" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueEntityBaseParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueEntityBaseParameters.cs new file mode 100644 index 000000000000..80f57c8aa5c9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueEntityBaseParameters.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Entity Base Parameters set. + public partial class NamedValueEntityBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal + { + + /// Backing field for property. + private bool? _secret; + + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Secret { get => this._secret; set => this._secret = value; } + + /// Backing field for property. + private string[] _tag; + + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Tag { get => this._tag; set => this._tag = value; } + + /// Creates an new instance. + public NamedValueEntityBaseParameters() + { + + } + } + /// NamedValue Entity Base Parameters set. + public partial interface INamedValueEntityBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether the value is a secret and should be encrypted or not. Default value is false.", + SerializedName = @"secret", + PossibleTypes = new [] { typeof(bool) })] + bool? Secret { get; set; } + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional tags that when provided can be used to filter the NamedValue list.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(string) })] + string[] Tag { get; set; } + + } + /// NamedValue Entity Base Parameters set. + internal partial interface INamedValueEntityBaseParametersInternal + + { + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + bool? Secret { get; set; } + /// Optional tags that when provided can be used to filter the NamedValue list. + string[] Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueEntityBaseParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueEntityBaseParameters.json.cs new file mode 100644 index 000000000000..5326cee28559 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueEntityBaseParameters.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Entity Base Parameters set. + public partial class NamedValueEntityBaseParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueEntityBaseParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueEntityBaseParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Tag;} + {_secret = If( json?.PropertyT("secret"), out var __jsonSecret) ? (bool?)__jsonSecret : Secret;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._tag) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._tag ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("tags",__w); + } + AddIf( null != this._secret ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._secret) : null, "secret" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueSecretContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueSecretContract.cs new file mode 100644 index 000000000000..a824b11d22d1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueSecretContract.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + public partial class NamedValueSecretContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueSecretContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueSecretContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Backing field for property. + private string _value; + + /// This is secret value of the NamedValue entity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueSecretContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public NamedValueSecretContract() + { + + } + } + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + public partial interface INamedValueSecretContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// This is secret value of the NamedValue entity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is secret value of the NamedValue entity.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + internal partial interface INamedValueSecretContractInternal + + { + string ETag { get; set; } + /// This is secret value of the NamedValue entity. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueSecretContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueSecretContract.json.cs new file mode 100644 index 000000000000..335edd5036b6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueSecretContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + public partial class NamedValueSecretContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueSecretContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueSecretContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueSecretContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueSecretContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueSecretContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameterProperties.cs new file mode 100644 index 000000000000..f14c50f3bf02 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameterProperties.cs @@ -0,0 +1,164 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Contract properties. + public partial class NamedValueUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParameters __namedValueEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueEntityBaseParameters(); + + /// Backing field for property. + private string _displayName; + + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties _keyVault; + + /// KeyVault location details of the namedValue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties()); set => this._keyVault = value; } + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).IdentityClientId = value ?? null; } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultSecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreatePropertiesInternal)KeyVault).SecretIdentifier = value ?? null; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal.KeyVault { get => (this._keyVault = this._keyVault ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties()); set { {_keyVault = value;} } } + + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? Secret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Secret = value ?? default(bool); } + + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string[] Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)__namedValueEntityBaseParameters).Tag = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _value; + + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NamedValueUpdateParameterProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__namedValueEntityBaseParameters), __namedValueEntityBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__namedValueEntityBaseParameters), __namedValueEntityBaseParameters); + } + } + /// NamedValue Contract properties. + public partial interface INamedValueUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParameters + { + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultSecretIdentifier { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// NamedValue Contract properties. + internal partial interface INamedValueUpdateParameterPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal + { + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + string DisplayName { get; set; } + /// KeyVault location details of the namedValue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties KeyVault { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string KeyVaultSecretIdentifier { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. + /// + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..a2c87dfa94b3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameterProperties.json.cs @@ -0,0 +1,115 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue Contract properties. + public partial class NamedValueUpdateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueUpdateParameterProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueUpdateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __namedValueEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueEntityBaseParameters(json); + {_keyVault = If( json?.PropertyT("keyVault"), out var __jsonKeyVault) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.KeyVaultContractCreateProperties.FromJson(__jsonKeyVault) : KeyVault;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __namedValueEntityBaseParameters?.ToJson(container, serializationMode); + AddIf( null != this._keyVault ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._keyVault.ToJson(null,serializationMode) : null, "keyVault" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameters.cs new file mode 100644 index 000000000000..8c1144e8e747 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameters.cs @@ -0,0 +1,168 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue update Parameters. + public partial class NamedValueUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParametersInternal + { + + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal)Property).DisplayName = value ?? null; } + + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal)Property).KeyVaultIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal)Property).KeyVaultIdentityClientId = value ?? null; } + + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string KeyVaultSecretIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal)Property).KeyVaultSecretIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal)Property).KeyVaultSecretIdentifier = value ?? null; } + + /// Internal Acessors for KeyVault + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParametersInternal.KeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal)Property).KeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal)Property).KeyVault = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueUpdateParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterProperties _property; + + /// NamedValue entity Update contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueUpdateParameterProperties()); set => this._property = value; } + + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Secret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Secret = value ?? default(bool); } + + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueEntityBaseParametersInternal)Property).Tag = value ?? null /* arrayOf */; } + + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterPropertiesInternal)Property).Value = value ?? null; } + + /// Creates an new instance. + public NamedValueUpdateParameters() + { + + } + } + /// NamedValue update Parameters. + public partial interface INamedValueUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret.", + SerializedName = @"identityClientId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi", + SerializedName = @"secretIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultSecretIdentifier { get; set; } + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether the value is a secret and should be encrypted or not. Default value is false.", + SerializedName = @"secret", + PossibleTypes = new [] { typeof(bool) })] + bool? Secret { get; set; } + /// Optional tags that when provided can be used to filter the NamedValue list. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional tags that when provided can be used to filter the NamedValue list.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(string) })] + string[] Tag { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// NamedValue update Parameters. + internal partial interface INamedValueUpdateParametersInternal + + { + /// + /// Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + /// + string DisplayName { get; set; } + /// KeyVault location details of the namedValue. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IKeyVaultContractCreateProperties KeyVault { get; set; } + /// + /// Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret. + /// + string KeyVaultIdentityClientId { get; set; } + /// + /// Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires + /// API Management service to be configured with aka.ms/apimmsi + /// + string KeyVaultSecretIdentifier { get; set; } + /// NamedValue entity Update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameterProperties Property { get; set; } + /// + /// Determines whether the value is a secret and should be encrypted or not. Default value is false. + /// + bool? Secret { get; set; } + /// Optional tags that when provided can be used to filter the NamedValue list. + string[] Tag { get; set; } + /// + /// Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. + /// + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameters.json.cs new file mode 100644 index 000000000000..09f0505789f1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NamedValueUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// NamedValue update Parameters. + public partial class NamedValueUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INamedValueUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NamedValueUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContract.cs new file mode 100644 index 000000000000..d14c1124c610 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContract.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Network Status details. + public partial class NetworkStatusContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract[] _connectivityStatus; + + /// + /// Gets the list of Connectivity Status to the Resources on which the service depends upon. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract[] ConnectivityStatus { get => this._connectivityStatus; set => this._connectivityStatus = value; } + + /// Backing field for property. + private string[] _dnsServer; + + /// Gets the list of DNS servers IPV4 addresses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] DnsServer { get => this._dnsServer; set => this._dnsServer = value; } + + /// Creates an new instance. + public NetworkStatusContract() + { + + } + } + /// Network Status details. + public partial interface INetworkStatusContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Gets the list of Connectivity Status to the Resources on which the service depends upon. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets the list of Connectivity Status to the Resources on which the service depends upon.", + SerializedName = @"connectivityStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract[] ConnectivityStatus { get; set; } + /// Gets the list of DNS servers IPV4 addresses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets the list of DNS servers IPV4 addresses.", + SerializedName = @"dnsServers", + PossibleTypes = new [] { typeof(string) })] + string[] DnsServer { get; set; } + + } + /// Network Status details. + internal partial interface INetworkStatusContractInternal + + { + /// + /// Gets the list of Connectivity Status to the Resources on which the service depends upon. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract[] ConnectivityStatus { get; set; } + /// Gets the list of DNS servers IPV4 addresses. + string[] DnsServer { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContract.json.cs new file mode 100644 index 000000000000..05ff563f20a9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContract.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Network Status details. + public partial class NetworkStatusContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NetworkStatusContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkStatusContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_dnsServer = If( json?.PropertyT("dnsServers"), out var __jsonDnsServers) ? If( __jsonDnsServers as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : DnsServer;} + {_connectivityStatus = If( json?.PropertyT("connectivityStatus"), out var __jsonConnectivityStatus) ? If( __jsonConnectivityStatus as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ConnectivityStatusContract.FromJson(__p) )) ))() : null : ConnectivityStatus;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._dnsServer) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._dnsServer ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("dnsServers",__w); + } + if (null != this._connectivityStatus) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._connectivityStatus ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("connectivityStatus",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContractByLocation.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContractByLocation.cs new file mode 100644 index 000000000000..384b2a5912cb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContractByLocation.cs @@ -0,0 +1,97 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Network Status in the Location + public partial class NetworkStatusContractByLocation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractByLocation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractByLocationInternal + { + + /// Backing field for property. + private string _location; + + /// Location of service + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for NetworkStatus + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractByLocationInternal.NetworkStatus { get => (this._networkStatus = this._networkStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NetworkStatusContract()); set { {_networkStatus = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContract _networkStatus; + + /// Network status in Location + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContract NetworkStatus { get => (this._networkStatus = this._networkStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NetworkStatusContract()); set => this._networkStatus = value; } + + /// + /// Gets the list of Connectivity Status to the Resources on which the service depends upon. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract[] NetworkStatusConnectivityStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractInternal)NetworkStatus).ConnectivityStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractInternal)NetworkStatus).ConnectivityStatus = value ?? null /* arrayOf */; } + + /// Gets the list of DNS servers IPV4 addresses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] NetworkStatusDnsServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractInternal)NetworkStatus).DnsServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractInternal)NetworkStatus).DnsServer = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public NetworkStatusContractByLocation() + { + + } + } + /// Network Status in the Location + public partial interface INetworkStatusContractByLocation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Location of service + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location of service", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// + /// Gets the list of Connectivity Status to the Resources on which the service depends upon. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets the list of Connectivity Status to the Resources on which the service depends upon.", + SerializedName = @"connectivityStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract[] NetworkStatusConnectivityStatus { get; set; } + /// Gets the list of DNS servers IPV4 addresses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets the list of DNS servers IPV4 addresses.", + SerializedName = @"dnsServers", + PossibleTypes = new [] { typeof(string) })] + string[] NetworkStatusDnsServer { get; set; } + + } + /// Network Status in the Location + internal partial interface INetworkStatusContractByLocationInternal + + { + /// Location of service + string Location { get; set; } + /// Network status in Location + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContract NetworkStatus { get; set; } + /// + /// Gets the list of Connectivity Status to the Resources on which the service depends upon. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IConnectivityStatusContract[] NetworkStatusConnectivityStatus { get; set; } + /// Gets the list of DNS servers IPV4 addresses. + string[] NetworkStatusDnsServer { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContractByLocation.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContractByLocation.json.cs new file mode 100644 index 000000000000..850d47139935 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NetworkStatusContractByLocation.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Network Status in the Location + public partial class NetworkStatusContractByLocation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractByLocation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractByLocation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INetworkStatusContractByLocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NetworkStatusContractByLocation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkStatusContractByLocation(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_networkStatus = If( json?.PropertyT("networkStatus"), out var __jsonNetworkStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NetworkStatusContract.FromJson(__jsonNetworkStatus) : NetworkStatus;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._networkStatus ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._networkStatus.ToJson(null,serializationMode) : null, "networkStatus" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationCollection.cs new file mode 100644 index 000000000000..03abcd4ad6c2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Notification list representation. + public partial class NotificationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public NotificationCollection() + { + + } + } + /// Paged Notification list representation. + public partial interface INotificationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContract[] Value { get; set; } + + } + /// Paged Notification list representation. + internal partial interface INotificationCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationCollection.json.cs new file mode 100644 index 000000000000..008b3a1d3302 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Notification list representation. + public partial class NotificationCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NotificationCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NotificationCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NotificationContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContract.cs new file mode 100644 index 000000000000..4dc87b3cc1a4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContract.cs @@ -0,0 +1,150 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Notification details. + public partial class NotificationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Description of the Notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal)Property).Description = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NotificationContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Recipient + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractInternal.Recipient { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal)Property).Recipient; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal)Property).Recipient = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractProperties _property; + + /// Notification entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NotificationContractProperties()); set => this._property = value; } + + /// List of Emails subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] RecipientEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal)Property).RecipientEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal)Property).RecipientEmail = value ?? null /* arrayOf */; } + + /// List of Users subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] RecipientUser { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal)Property).RecipientUser; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal)Property).RecipientUser = value ?? null /* arrayOf */; } + + /// Title of the Notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal)Property).Title = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public NotificationContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Notification details. + public partial interface INotificationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Description of the Notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the Notification.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// List of Emails subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Emails subscribed for the notification.", + SerializedName = @"emails", + PossibleTypes = new [] { typeof(string) })] + string[] RecipientEmail { get; set; } + /// List of Users subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Users subscribed for the notification.", + SerializedName = @"users", + PossibleTypes = new [] { typeof(string) })] + string[] RecipientUser { get; set; } + /// Title of the Notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Title of the Notification.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Notification details. + internal partial interface INotificationContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Description of the Notification. + string Description { get; set; } + /// Notification entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractProperties Property { get; set; } + /// Recipient Parameter values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractProperties Recipient { get; set; } + /// List of Emails subscribed for the notification. + string[] RecipientEmail { get; set; } + /// List of Users subscribed for the notification. + string[] RecipientUser { get; set; } + /// Title of the Notification. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContract.json.cs new file mode 100644 index 000000000000..b318b2f98a53 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Notification details. + public partial class NotificationContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NotificationContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NotificationContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.NotificationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContractProperties.cs new file mode 100644 index 000000000000..1f4c2eaf6527 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContractProperties.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Notification Contract properties. + public partial class NotificationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the Notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Internal Acessors for Recipient + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractPropertiesInternal.Recipient { get => (this._recipient = this._recipient ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientsContractProperties()); set { {_recipient = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractProperties _recipient; + + /// Recipient Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractProperties Recipient { get => (this._recipient = this._recipient ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientsContractProperties()); set => this._recipient = value; } + + /// List of Emails subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] RecipientEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractPropertiesInternal)Recipient).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractPropertiesInternal)Recipient).Email = value ?? null /* arrayOf */; } + + /// List of Users subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] RecipientUser { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractPropertiesInternal)Recipient).User; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractPropertiesInternal)Recipient).User = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _title; + + /// Title of the Notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// Creates an new instance. + public NotificationContractProperties() + { + + } + } + /// Notification Contract properties. + public partial interface INotificationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of the Notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the Notification.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// List of Emails subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Emails subscribed for the notification.", + SerializedName = @"emails", + PossibleTypes = new [] { typeof(string) })] + string[] RecipientEmail { get; set; } + /// List of Users subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Users subscribed for the notification.", + SerializedName = @"users", + PossibleTypes = new [] { typeof(string) })] + string[] RecipientUser { get; set; } + /// Title of the Notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Title of the Notification.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Notification Contract properties. + internal partial interface INotificationContractPropertiesInternal + + { + /// Description of the Notification. + string Description { get; set; } + /// Recipient Parameter values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractProperties Recipient { get; set; } + /// List of Emails subscribed for the notification. + string[] RecipientEmail { get; set; } + /// List of Users subscribed for the notification. + string[] RecipientUser { get; set; } + /// Title of the Notification. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContractProperties.json.cs new file mode 100644 index 000000000000..8765e33b9683 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/NotificationContractProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Notification Contract properties. + public partial class NotificationContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.INotificationContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NotificationContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NotificationContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_recipient = If( json?.PropertyT("recipients"), out var __jsonRecipients) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientsContractProperties.FromJson(__jsonRecipients) : Recipient;} + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._recipient ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._recipient.ToJson(null,serializationMode) : null, "recipients" ,container.Add ); + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OAuth2AuthenticationSettingsContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OAuth2AuthenticationSettingsContract.cs new file mode 100644 index 000000000000..e5b1e24f03bf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OAuth2AuthenticationSettingsContract.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API OAuth2 Authentication settings details. + public partial class OAuth2AuthenticationSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContractInternal + { + + /// Backing field for property. + private string _authorizationServerId; + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AuthorizationServerId { get => this._authorizationServerId; set => this._authorizationServerId = value; } + + /// Backing field for property. + private string _scope; + + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Creates an new instance. + public OAuth2AuthenticationSettingsContract() + { + + } + } + /// API OAuth2 Authentication settings details. + public partial interface IOAuth2AuthenticationSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"authorizationServerId", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationServerId { get; set; } + /// operations scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operations scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + + } + /// API OAuth2 Authentication settings details. + internal partial interface IOAuth2AuthenticationSettingsContractInternal + + { + /// OAuth authorization server identifier. + string AuthorizationServerId { get; set; } + /// operations scope. + string Scope { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OAuth2AuthenticationSettingsContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OAuth2AuthenticationSettingsContract.json.cs new file mode 100644 index 000000000000..eaafe77e5103 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OAuth2AuthenticationSettingsContract.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API OAuth2 Authentication settings details. + public partial class OAuth2AuthenticationSettingsContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOAuth2AuthenticationSettingsContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OAuth2AuthenticationSettingsContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OAuth2AuthenticationSettingsContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authorizationServerId = If( json?.PropertyT("authorizationServerId"), out var __jsonAuthorizationServerId) ? (string)__jsonAuthorizationServerId : (string)AuthorizationServerId;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._authorizationServerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._authorizationServerId.ToString()) : null, "authorizationServerId" ,container.Add ); + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdAuthenticationSettingsContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdAuthenticationSettingsContract.cs new file mode 100644 index 000000000000..68b3bb848856 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdAuthenticationSettingsContract.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API OAuth2 Authentication settings details. + public partial class OpenIdAuthenticationSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContractInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] _bearerTokenSendingMethod; + + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] BearerTokenSendingMethod { get => this._bearerTokenSendingMethod; set => this._bearerTokenSendingMethod = value; } + + /// Backing field for property. + private string _openidProviderId; + + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string OpenidProviderId { get => this._openidProviderId; set => this._openidProviderId = value; } + + /// Creates an new instance. + public OpenIdAuthenticationSettingsContract() + { + + } + } + /// API OAuth2 Authentication settings details. + public partial interface IOpenIdAuthenticationSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// How to send token to the server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"How to send token to the server.", + SerializedName = @"bearerTokenSendingMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] BearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OAuth authorization server identifier.", + SerializedName = @"openidProviderId", + PossibleTypes = new [] { typeof(string) })] + string OpenidProviderId { get; set; } + + } + /// API OAuth2 Authentication settings details. + internal partial interface IOpenIdAuthenticationSettingsContractInternal + + { + /// How to send token to the server. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods[] BearerTokenSendingMethod { get; set; } + /// OAuth authorization server identifier. + string OpenidProviderId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdAuthenticationSettingsContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdAuthenticationSettingsContract.json.cs new file mode 100644 index 000000000000..25c6efaf609d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdAuthenticationSettingsContract.json.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API OAuth2 Authentication settings details. + public partial class OpenIdAuthenticationSettingsContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdAuthenticationSettingsContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OpenIdAuthenticationSettingsContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OpenIdAuthenticationSettingsContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_openidProviderId = If( json?.PropertyT("openidProviderId"), out var __jsonOpenidProviderId) ? (string)__jsonOpenidProviderId : (string)OpenidProviderId;} + {_bearerTokenSendingMethod = If( json?.PropertyT("bearerTokenSendingMethods"), out var __jsonBearerTokenSendingMethods) ? If( __jsonBearerTokenSendingMethods as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods)""))) ))() : null : BearerTokenSendingMethod;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._openidProviderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._openidProviderId.ToString()) : null, "openidProviderId" ,container.Add ); + if (null != this._bearerTokenSendingMethod) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._bearerTokenSendingMethod ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("bearerTokenSendingMethods",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdConnectProviderCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdConnectProviderCollection.cs new file mode 100644 index 000000000000..ba947610a145 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdConnectProviderCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged OpenIdProviders list representation. + public partial class OpenIdConnectProviderCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdConnectProviderCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdConnectProviderCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public OpenIdConnectProviderCollection() + { + + } + } + /// Paged OpenIdProviders list representation. + public partial interface IOpenIdConnectProviderCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract[] Value { get; set; } + + } + /// Paged OpenIdProviders list representation. + internal partial interface IOpenIdConnectProviderCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdConnectProviderCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdConnectProviderCollection.json.cs new file mode 100644 index 000000000000..7de10877bdc2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenIdConnectProviderCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged OpenIdProviders list representation. + public partial class OpenIdConnectProviderCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdConnectProviderCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdConnectProviderCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenIdConnectProviderCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OpenIdConnectProviderCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OpenIdConnectProviderCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContract.cs new file mode 100644 index 000000000000..dbf0c4cd99c6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContract.cs @@ -0,0 +1,231 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OpenId Connect Provider details. + public partial class OpenidConnectProviderContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Client ID of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).ClientId = value ?? null; } + + /// Client Secret of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).ClientSecret = value ?? null; } + + /// User-friendly description of OpenID Connect Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).Description = value ?? null; } + + /// User-friendly OpenID Connect Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Metadata endpoint URI. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string MetadataEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).MetadataEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).MetadataEndpoint = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractProperties _property; + + /// OpenId Connect Provider contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UseInApiDocumentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).UseInApiDocumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).UseInApiDocumentation = value ?? default(bool); } + + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UseInTestConsole { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).UseInTestConsole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal)Property).UseInTestConsole = value ?? default(bool); } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public OpenidConnectProviderContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// OpenId Connect Provider details. + public partial interface IOpenidConnectProviderContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Client ID of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client ID of developer console which is the client application.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// Client Secret of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client Secret of developer console which is the client application.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + /// User-friendly description of OpenID Connect Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-friendly description of OpenID Connect Provider.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// User-friendly OpenID Connect Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-friendly OpenID Connect Provider name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Metadata endpoint URI. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metadata endpoint URI.", + SerializedName = @"metadataEndpoint", + PossibleTypes = new [] { typeof(string) })] + string MetadataEndpoint { get; set; } + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default if no value is provided.", + SerializedName = @"useInApiDocumentation", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is provided.", + SerializedName = @"useInTestConsole", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInTestConsole { get; set; } + + } + /// OpenId Connect Provider details. + internal partial interface IOpenidConnectProviderContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Client ID of developer console which is the client application. + string ClientId { get; set; } + /// Client Secret of developer console which is the client application. + string ClientSecret { get; set; } + /// User-friendly description of OpenID Connect Provider. + string Description { get; set; } + /// User-friendly OpenID Connect Provider name. + string DisplayName { get; set; } + + string ETag { get; set; } + /// Metadata endpoint URI. + string MetadataEndpoint { get; set; } + /// OpenId Connect Provider contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractProperties Property { get; set; } + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + bool? UseInTestConsole { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContract.json.cs new file mode 100644 index 000000000000..d235f5d620fb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OpenId Connect Provider details. + public partial class OpenidConnectProviderContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OpenidConnectProviderContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OpenidConnectProviderContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContractProperties.cs new file mode 100644 index 000000000000..e96d8714c324 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContractProperties.cs @@ -0,0 +1,171 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OpenID Connect Providers Contract. + public partial class OpenidConnectProviderContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractPropertiesInternal + { + + /// Backing field for property. + private string _clientId; + + /// Client ID of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// Backing field for property. + private string _clientSecret; + + /// Client Secret of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientSecret { get => this._clientSecret; set => this._clientSecret = value; } + + /// Backing field for property. + private string _description; + + /// User-friendly description of OpenID Connect Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _displayName; + + /// User-friendly OpenID Connect Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _metadataEndpoint; + + /// Metadata endpoint URI. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string MetadataEndpoint { get => this._metadataEndpoint; set => this._metadataEndpoint = value; } + + /// Backing field for property. + private bool? _useInApiDocumentation; + + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? UseInApiDocumentation { get => this._useInApiDocumentation; set => this._useInApiDocumentation = value; } + + /// Backing field for property. + private bool? _useInTestConsole; + + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? UseInTestConsole { get => this._useInTestConsole; set => this._useInTestConsole = value; } + + /// Creates an new instance. + public OpenidConnectProviderContractProperties() + { + + } + } + /// OpenID Connect Providers Contract. + public partial interface IOpenidConnectProviderContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Client ID of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Client ID of developer console which is the client application.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// Client Secret of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client Secret of developer console which is the client application.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + /// User-friendly description of OpenID Connect Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-friendly description of OpenID Connect Provider.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// User-friendly OpenID Connect Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"User-friendly OpenID Connect Provider name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Metadata endpoint URI. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Metadata endpoint URI.", + SerializedName = @"metadataEndpoint", + PossibleTypes = new [] { typeof(string) })] + string MetadataEndpoint { get; set; } + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default if no value is provided.", + SerializedName = @"useInApiDocumentation", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is provided.", + SerializedName = @"useInTestConsole", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInTestConsole { get; set; } + + } + /// OpenID Connect Providers Contract. + internal partial interface IOpenidConnectProviderContractPropertiesInternal + + { + /// Client ID of developer console which is the client application. + string ClientId { get; set; } + /// Client Secret of developer console which is the client application. + string ClientSecret { get; set; } + /// User-friendly description of OpenID Connect Provider. + string Description { get; set; } + /// User-friendly OpenID Connect Provider name. + string DisplayName { get; set; } + /// Metadata endpoint URI. + string MetadataEndpoint { get; set; } + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + bool? UseInTestConsole { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContractProperties.json.cs new file mode 100644 index 000000000000..4b1bf92725c2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderContractProperties.json.cs @@ -0,0 +1,122 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OpenID Connect Providers Contract. + public partial class OpenidConnectProviderContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OpenidConnectProviderContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OpenidConnectProviderContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_metadataEndpoint = If( json?.PropertyT("metadataEndpoint"), out var __jsonMetadataEndpoint) ? (string)__jsonMetadataEndpoint : (string)MetadataEndpoint;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} + {_useInTestConsole = If( json?.PropertyT("useInTestConsole"), out var __jsonUseInTestConsole) ? (bool?)__jsonUseInTestConsole : UseInTestConsole;} + {_useInApiDocumentation = If( json?.PropertyT("useInApiDocumentation"), out var __jsonUseInApiDocumentation) ? (bool?)__jsonUseInApiDocumentation : UseInApiDocumentation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._metadataEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._metadataEndpoint.ToString()) : null, "metadataEndpoint" ,container.Add ); + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AddIf( null != (((object)this._clientSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientSecret.ToString()) : null, "clientSecret" ,container.Add ); + AddIf( null != this._useInTestConsole ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._useInTestConsole) : null, "useInTestConsole" ,container.Add ); + AddIf( null != this._useInApiDocumentation ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._useInApiDocumentation) : null, "useInApiDocumentation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContract.cs new file mode 100644 index 000000000000..4d09ee3a0c32 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContract.cs @@ -0,0 +1,162 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update OpenID Connect Provider operation. + public partial class OpenidConnectProviderUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractInternal + { + + /// Client ID of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).ClientId = value ?? null; } + + /// Client Secret of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ClientSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).ClientSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).ClientSecret = value ?? null; } + + /// User-friendly description of OpenID Connect Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).Description = value ?? null; } + + /// User-friendly OpenID Connect Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Metadata endpoint URI. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string MetadataEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).MetadataEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).MetadataEndpoint = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderUpdateContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractProperties _property; + + /// OpenId Connect Provider Update contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderUpdateContractProperties()); set => this._property = value; } + + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UseInApiDocumentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).UseInApiDocumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).UseInApiDocumentation = value ?? default(bool); } + + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UseInTestConsole { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).UseInTestConsole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal)Property).UseInTestConsole = value ?? default(bool); } + + /// Creates an new instance. + public OpenidConnectProviderUpdateContract() + { + + } + } + /// Parameters supplied to the Update OpenID Connect Provider operation. + public partial interface IOpenidConnectProviderUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Client ID of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client ID of developer console which is the client application.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// Client Secret of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client Secret of developer console which is the client application.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + /// User-friendly description of OpenID Connect Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-friendly description of OpenID Connect Provider.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// User-friendly OpenID Connect Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-friendly OpenID Connect Provider name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Metadata endpoint URI. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metadata endpoint URI.", + SerializedName = @"metadataEndpoint", + PossibleTypes = new [] { typeof(string) })] + string MetadataEndpoint { get; set; } + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default if no value is provided.", + SerializedName = @"useInApiDocumentation", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is provided.", + SerializedName = @"useInTestConsole", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInTestConsole { get; set; } + + } + /// Parameters supplied to the Update OpenID Connect Provider operation. + internal partial interface IOpenidConnectProviderUpdateContractInternal + + { + /// Client ID of developer console which is the client application. + string ClientId { get; set; } + /// Client Secret of developer console which is the client application. + string ClientSecret { get; set; } + /// User-friendly description of OpenID Connect Provider. + string Description { get; set; } + /// User-friendly OpenID Connect Provider name. + string DisplayName { get; set; } + /// Metadata endpoint URI. + string MetadataEndpoint { get; set; } + /// OpenId Connect Provider Update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractProperties Property { get; set; } + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + bool? UseInTestConsole { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContract.json.cs new file mode 100644 index 000000000000..cde3aed907d2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContract.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update OpenID Connect Provider operation. + public partial class OpenidConnectProviderUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OpenidConnectProviderUpdateContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OpenidConnectProviderUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OpenidConnectProviderUpdateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContractProperties.cs new file mode 100644 index 000000000000..c5fcb444bf56 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContractProperties.cs @@ -0,0 +1,173 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update OpenID Connect Provider operation. + public partial class OpenidConnectProviderUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractPropertiesInternal + { + + /// Backing field for property. + private string _clientId; + + /// Client ID of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// Backing field for property. + private string _clientSecret; + + /// Client Secret of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientSecret { get => this._clientSecret; set => this._clientSecret = value; } + + /// Backing field for property. + private string _description; + + /// User-friendly description of OpenID Connect Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _displayName; + + /// User-friendly OpenID Connect Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _metadataEndpoint; + + /// Metadata endpoint URI. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string MetadataEndpoint { get => this._metadataEndpoint; set => this._metadataEndpoint = value; } + + /// Backing field for property. + private bool? _useInApiDocumentation; + + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? UseInApiDocumentation { get => this._useInApiDocumentation; set => this._useInApiDocumentation = value; } + + /// Backing field for property. + private bool? _useInTestConsole; + + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? UseInTestConsole { get => this._useInTestConsole; set => this._useInTestConsole = value; } + + /// + /// Creates an new instance. + /// + public OpenidConnectProviderUpdateContractProperties() + { + + } + } + /// Parameters supplied to the Update OpenID Connect Provider operation. + public partial interface IOpenidConnectProviderUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Client ID of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client ID of developer console which is the client application.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// Client Secret of developer console which is the client application. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Client Secret of developer console which is the client application.", + SerializedName = @"clientSecret", + PossibleTypes = new [] { typeof(string) })] + string ClientSecret { get; set; } + /// User-friendly description of OpenID Connect Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-friendly description of OpenID Connect Provider.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// User-friendly OpenID Connect Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-friendly OpenID Connect Provider name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Metadata endpoint URI. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metadata endpoint URI.", + SerializedName = @"metadataEndpoint", + PossibleTypes = new [] { typeof(string) })] + string MetadataEndpoint { get; set; } + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default if no value is provided.", + SerializedName = @"useInApiDocumentation", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is provided.", + SerializedName = @"useInTestConsole", + PossibleTypes = new [] { typeof(bool) })] + bool? UseInTestConsole { get; set; } + + } + /// Parameters supplied to the Update OpenID Connect Provider operation. + internal partial interface IOpenidConnectProviderUpdateContractPropertiesInternal + + { + /// Client ID of developer console which is the client application. + string ClientId { get; set; } + /// Client Secret of developer console which is the client application. + string ClientSecret { get; set; } + /// User-friendly description of OpenID Connect Provider. + string Description { get; set; } + /// User-friendly OpenID Connect Provider name. + string DisplayName { get; set; } + /// Metadata endpoint URI. + string MetadataEndpoint { get; set; } + /// + /// If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default + /// if no value is provided. + /// + bool? UseInApiDocumentation { get; set; } + /// + /// If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + /// provided. + /// + bool? UseInTestConsole { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContractProperties.json.cs new file mode 100644 index 000000000000..c14e9d860525 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OpenidConnectProviderUpdateContractProperties.json.cs @@ -0,0 +1,123 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update OpenID Connect Provider operation. + public partial class OpenidConnectProviderUpdateContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOpenidConnectProviderUpdateContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OpenidConnectProviderUpdateContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OpenidConnectProviderUpdateContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_metadataEndpoint = If( json?.PropertyT("metadataEndpoint"), out var __jsonMetadataEndpoint) ? (string)__jsonMetadataEndpoint : (string)MetadataEndpoint;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_clientSecret = If( json?.PropertyT("clientSecret"), out var __jsonClientSecret) ? (string)__jsonClientSecret : (string)ClientSecret;} + {_useInTestConsole = If( json?.PropertyT("useInTestConsole"), out var __jsonUseInTestConsole) ? (bool?)__jsonUseInTestConsole : UseInTestConsole;} + {_useInApiDocumentation = If( json?.PropertyT("useInApiDocumentation"), out var __jsonUseInApiDocumentation) ? (bool?)__jsonUseInApiDocumentation : UseInApiDocumentation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._metadataEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._metadataEndpoint.ToString()) : null, "metadataEndpoint" ,container.Add ); + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AddIf( null != (((object)this._clientSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientSecret.ToString()) : null, "clientSecret" ,container.Add ); + AddIf( null != this._useInTestConsole ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._useInTestConsole) : null, "useInTestConsole" ,container.Add ); + AddIf( null != this._useInApiDocumentation ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._useInApiDocumentation) : null, "useInApiDocumentation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/Operation.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/Operation.cs new file mode 100644 index 000000000000..f96c34141962 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/Operation.cs @@ -0,0 +1,153 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// REST API operation + public partial class Operation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplay _display; + + /// The object that describes the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationDisplay()); set => this._display = value; } + + /// Friendly name of the operation + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplayInternal)Display).Description = value ?? null; } + + /// Operation type: read, write, delete, listKeys/action, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplayInternal)Display).Operation = value ?? null; } + + /// Friendly name of the resource provider + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplayInternal)Display).Provider = value ?? null; } + + /// Resource type on which the operation is performed. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplayInternal)Display).Resource = value ?? null; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationDisplay()); set { {_display = value;} } } + + /// Backing field for property. + private string _name; + + /// Operation name: {provider}/{resource}/{operation} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _origin; + + /// The operation origin. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Origin { get => this._origin; set => this._origin = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny _property; + + /// The operation properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any()); set => this._property = value; } + + /// Creates an new instance. + public Operation() + { + + } + } + /// REST API operation + public partial interface IOperation : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Friendly name of the operation + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the operation", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; set; } + /// Operation type: read, write, delete, listKeys/action, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation type: read, write, delete, listKeys/action, etc.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; set; } + /// Friendly name of the resource provider + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the resource provider", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; set; } + /// Resource type on which the operation is performed. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource type on which the operation is performed.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; set; } + /// Operation name: {provider}/{resource}/{operation} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation name: {provider}/{resource}/{operation}", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The operation origin. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operation origin.", + SerializedName = @"origin", + PossibleTypes = new [] { typeof(string) })] + string Origin { get; set; } + /// The operation properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operation properties.", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Property { get; set; } + + } + /// REST API operation + internal partial interface IOperationInternal + + { + /// The object that describes the operation. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplay Display { get; set; } + /// Friendly name of the operation + string DisplayDescription { get; set; } + /// Operation type: read, write, delete, listKeys/action, etc. + string DisplayOperation { get; set; } + /// Friendly name of the resource provider + string DisplayProvider { get; set; } + /// Resource type on which the operation is performed. + string DisplayResource { get; set; } + /// Operation name: {provider}/{resource}/{operation} + string Name { get; set; } + /// The operation origin. + string Origin { get; set; } + /// The operation properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/Operation.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/Operation.json.cs new file mode 100644 index 000000000000..52e8dfcc84a7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/Operation.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// REST API operation + public partial class Operation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new Operation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal Operation(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationDisplay.FromJson(__jsonDisplay) : Display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationCollection.cs new file mode 100644 index 000000000000..8105b11f7075 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Operation list representation. + public partial class OperationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract[] Value { get => this._value; } + + /// Creates an new instance. + public OperationCollection() + { + + } + } + /// Paged Operation list representation. + public partial interface IOperationCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract[] Value { get; } + + } + /// Paged Operation list representation. + internal partial interface IOperationCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationCollection.json.cs new file mode 100644 index 000000000000..bafee963a162 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Operation list representation. + public partial class OperationCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContract.cs new file mode 100644 index 000000000000..0c3f73920bcb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContract.cs @@ -0,0 +1,286 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Operation details. + public partial class OperationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Description of the operation. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Description = value ?? null; } + + /// Operation Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Method { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractPropertiesInternal)Property).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractPropertiesInternal)Property).Method = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Request + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractInternal.Request { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Request = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Operation Policies + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Policy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Policy = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractProperties _property; + + /// Properties of the Operation Contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContractProperties()); set => this._property = value; } + + /// Operation request description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string RequestDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestDescription = value ?? null; } + + /// Collection of operation request headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestHeader = value ?? null /* arrayOf */; } + + /// Collection of operation request query parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestQueryParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestQueryParameter = value ?? null /* arrayOf */; } + + /// Collection of operation request representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestRepresentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestRepresentation = value ?? null /* arrayOf */; } + + /// Array of Operation responses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Response = value ?? null /* arrayOf */; } + + /// Collection of URL template parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).TemplateParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).TemplateParameter = value ?? null /* arrayOf */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string UrlTemplate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractPropertiesInternal)Property).UrlTemplate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractPropertiesInternal)Property).UrlTemplate = value ?? null; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public OperationContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// API Operation details. + public partial interface IOperationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Description of the operation. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Operation Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation Name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.", + SerializedName = @"method", + PossibleTypes = new [] { typeof(string) })] + string Method { get; set; } + /// Operation Policies + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation Policies", + SerializedName = @"policies", + PossibleTypes = new [] { typeof(string) })] + string Policy { get; set; } + /// Operation request description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation request description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string RequestDescription { get; set; } + /// Collection of operation request headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request headers.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get; set; } + /// Collection of operation request query parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request query parameters.", + SerializedName = @"queryParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get; set; } + /// Collection of operation request representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request representations.", + SerializedName = @"representations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get; set; } + /// Array of Operation responses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of Operation responses.", + SerializedName = @"responses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get; set; } + /// Collection of URL template parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of URL template parameters.", + SerializedName = @"templateParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get; set; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}", + SerializedName = @"urlTemplate", + PossibleTypes = new [] { typeof(string) })] + string UrlTemplate { get; set; } + + } + /// API Operation details. + internal partial interface IOperationContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Description of the operation. May include HTML formatting tags. + string Description { get; set; } + /// Operation Name. + string DisplayName { get; set; } + + string ETag { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + string Method { get; set; } + /// Operation Policies + string Policy { get; set; } + /// Properties of the Operation Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractProperties Property { get; set; } + /// An entity containing request details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract Request { get; set; } + /// Operation request description. + string RequestDescription { get; set; } + /// Collection of operation request headers. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get; set; } + /// Collection of operation request query parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get; set; } + /// Collection of operation request representations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get; set; } + /// Array of Operation responses. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get; set; } + /// Collection of URL template parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get; set; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + string UrlTemplate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContract.json.cs new file mode 100644 index 000000000000..85419bdf53b4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Operation details. + public partial class OperationContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContractProperties.cs new file mode 100644 index 000000000000..d9fb8122a4f6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContractProperties.cs @@ -0,0 +1,152 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Contract Properties + public partial class OperationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContract __operationEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationEntityBaseContract(); + + /// Description of the operation. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// Operation Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _method; + + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Method { get => this._method; set => this._method = value; } + + /// Operation Policies + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Policy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Policy = value ?? null; } + + /// An entity containing request details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract Request { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Request = value ?? null /* model class */; } + + /// Operation request description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string RequestDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestDescription = value ?? null; } + + /// Collection of operation request headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestHeader = value ?? null /* arrayOf */; } + + /// Collection of operation request query parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestQueryParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestQueryParameter = value ?? null /* arrayOf */; } + + /// Collection of operation request representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestRepresentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestRepresentation = value ?? null /* arrayOf */; } + + /// Array of Operation responses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Response = value ?? null /* arrayOf */; } + + /// Collection of URL template parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).TemplateParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).TemplateParameter = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _urlTemplate; + + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UrlTemplate { get => this._urlTemplate; set => this._urlTemplate = value; } + + /// Creates an new instance. + public OperationContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__operationEntityBaseContract), __operationEntityBaseContract); + await eventListener.AssertObjectIsValid(nameof(__operationEntityBaseContract), __operationEntityBaseContract); + } + } + /// Operation Contract Properties + public partial interface IOperationContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContract + { + /// Operation Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Operation Name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.", + SerializedName = @"method", + PossibleTypes = new [] { typeof(string) })] + string Method { get; set; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}", + SerializedName = @"urlTemplate", + PossibleTypes = new [] { typeof(string) })] + string UrlTemplate { get; set; } + + } + /// Operation Contract Properties + internal partial interface IOperationContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal + { + /// Operation Name. + string DisplayName { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + string Method { get; set; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + string UrlTemplate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContractProperties.json.cs new file mode 100644 index 000000000000..e4906217bb18 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationContractProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Contract Properties + public partial class OperationContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __operationEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationEntityBaseContract(json); + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_method = If( json?.PropertyT("method"), out var __jsonMethod) ? (string)__jsonMethod : (string)Method;} + {_urlTemplate = If( json?.PropertyT("urlTemplate"), out var __jsonUrlTemplate) ? (string)__jsonUrlTemplate : (string)UrlTemplate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __operationEntityBaseContract?.ToJson(container, serializationMode); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._method)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._method.ToString()) : null, "method" ,container.Add ); + AddIf( null != (((object)this._urlTemplate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._urlTemplate.ToString()) : null, "urlTemplate" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationDisplay.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationDisplay.cs new file mode 100644 index 000000000000..6f39101d4d2c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationDisplay.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The object that describes the operation. + public partial class OperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplayInternal + { + + /// Backing field for property. + private string _description; + + /// Friendly name of the operation + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _operation; + + /// Operation type: read, write, delete, listKeys/action, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private string _provider; + + /// Friendly name of the resource provider + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Backing field for property. + private string _resource; + + /// Resource type on which the operation is performed. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Resource { get => this._resource; set => this._resource = value; } + + /// Creates an new instance. + public OperationDisplay() + { + + } + } + /// The object that describes the operation. + public partial interface IOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Friendly name of the operation + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the operation", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Operation type: read, write, delete, listKeys/action, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation type: read, write, delete, listKeys/action, etc.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// Friendly name of the resource provider + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name of the resource provider", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + /// Resource type on which the operation is performed. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource type on which the operation is performed.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; set; } + + } + /// The object that describes the operation. + internal partial interface IOperationDisplayInternal + + { + /// Friendly name of the operation + string Description { get; set; } + /// Operation type: read, write, delete, listKeys/action, etc. + string Operation { get; set; } + /// Friendly name of the resource provider + string Provider { get; set; } + /// Resource type on which the operation is performed. + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationDisplay.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationDisplay.json.cs new file mode 100644 index 000000000000..93e5d848fd28 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationDisplay.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The object that describes the operation. + public partial class OperationDisplay + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationEntityBaseContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationEntityBaseContract.cs new file mode 100644 index 000000000000..770921a209ad --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationEntityBaseContract.cs @@ -0,0 +1,170 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Operation Entity Base Contract details. + public partial class OperationEntityBaseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the operation. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Internal Acessors for Request + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal.Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RequestContract()); set { {_request = value;} } } + + /// Backing field for property. + private string _policy; + + /// Operation Policies + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Policy { get => this._policy; set => this._policy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract _request; + + /// An entity containing request details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RequestContract()); set => this._request = value; } + + /// Operation request description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string RequestDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContractInternal)Request).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContractInternal)Request).Description = value ?? null; } + + /// Collection of operation request headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContractInternal)Request).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContractInternal)Request).Header = value ?? null /* arrayOf */; } + + /// Collection of operation request query parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContractInternal)Request).QueryParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContractInternal)Request).QueryParameter = value ?? null /* arrayOf */; } + + /// Collection of operation request representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContractInternal)Request).Representation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContractInternal)Request).Representation = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] _response; + + /// Array of Operation responses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get => this._response; set => this._response = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] _templateParameter; + + /// Collection of URL template parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get => this._templateParameter; set => this._templateParameter = value; } + + /// Creates an new instance. + public OperationEntityBaseContract() + { + + } + } + /// API Operation Entity Base Contract details. + public partial interface IOperationEntityBaseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of the operation. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Operation Policies + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation Policies", + SerializedName = @"policies", + PossibleTypes = new [] { typeof(string) })] + string Policy { get; set; } + /// Operation request description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation request description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string RequestDescription { get; set; } + /// Collection of operation request headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request headers.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get; set; } + /// Collection of operation request query parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request query parameters.", + SerializedName = @"queryParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get; set; } + /// Collection of operation request representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request representations.", + SerializedName = @"representations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get; set; } + /// Array of Operation responses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of Operation responses.", + SerializedName = @"responses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get; set; } + /// Collection of URL template parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of URL template parameters.", + SerializedName = @"templateParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get; set; } + + } + /// API Operation Entity Base Contract details. + internal partial interface IOperationEntityBaseContractInternal + + { + /// Description of the operation. May include HTML formatting tags. + string Description { get; set; } + /// Operation Policies + string Policy { get; set; } + /// An entity containing request details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract Request { get; set; } + /// Operation request description. + string RequestDescription { get; set; } + /// Collection of operation request headers. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get; set; } + /// Collection of operation request query parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get; set; } + /// Collection of operation request representations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get; set; } + /// Array of Operation responses. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get; set; } + /// Collection of URL template parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationEntityBaseContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationEntityBaseContract.json.cs new file mode 100644 index 000000000000..0cff32ca5877 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationEntityBaseContract.json.cs @@ -0,0 +1,132 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Operation Entity Base Contract details. + public partial class OperationEntityBaseContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationEntityBaseContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationEntityBaseContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_request = If( json?.PropertyT("request"), out var __jsonRequest) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RequestContract.FromJson(__jsonRequest) : Request;} + {_templateParameter = If( json?.PropertyT("templateParameters"), out var __jsonTemplateParameters) ? If( __jsonTemplateParameters as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterContract.FromJson(__u) )) ))() : null : TemplateParameter;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_response = If( json?.PropertyT("responses"), out var __jsonResponses) ? If( __jsonResponses as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResponseContract.FromJson(__p) )) ))() : null : Response;} + {_policy = If( json?.PropertyT("policies"), out var __jsonPolicies) ? (string)__jsonPolicies : (string)Policy;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._request ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._request.ToJson(null,serializationMode) : null, "request" ,container.Add ); + if (null != this._templateParameter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._templateParameter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("templateParameters",__w); + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + if (null != this._response) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._response ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("responses",__r); + } + AddIf( null != (((object)this._policy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._policy.ToString()) : null, "policies" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationListResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationListResult.cs new file mode 100644 index 000000000000..6c9909507d33 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationListResult.cs @@ -0,0 +1,73 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next + /// set of results. + /// + public partial class OperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// URL to get the next set of operation list results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperation[] _value; + + /// List of operations supported by the resource provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperation[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public OperationListResult() + { + + } + } + /// Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next + /// set of results. + public partial interface IOperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// URL to get the next set of operation list results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"URL to get the next set of operation list results if there are any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// List of operations supported by the resource provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of operations supported by the resource provider.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperation[] Value { get; set; } + + } + /// Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next + /// set of results. + internal partial interface IOperationListResultInternal + + { + /// URL to get the next set of operation list results if there are any. + string NextLink { get; set; } + /// List of operations supported by the resource provider. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationListResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationListResult.json.cs new file mode 100644 index 000000000000..772a0ed95656 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationListResult.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next + /// set of results. + /// + public partial class OperationListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.Operation.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContract.cs new file mode 100644 index 000000000000..e502591ee4ff --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContract.cs @@ -0,0 +1,258 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Long Running Git Operation Results. + public partial class OperationResultContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract[] ActionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).ActionLog; } + + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Code = value ?? null; } + + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Detail = value ?? null /* arrayOf */; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Message = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for ActionLog + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractInternal.ActionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).ActionLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).ActionLog = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Error = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationResultContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Operation result identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PropertiesId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractProperties _property; + + /// Properties of the Operation Contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationResultContractProperties()); set => this._property = value; } + + /// Optional result info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResultInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).ResultInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).ResultInfo = value ?? null; } + + /// + /// Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? Started { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Started; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Started = value ?? default(global::System.DateTime); } + + /// Status of an async operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + /// Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? Updated { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Updated; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal)Property).Updated = value ?? default(global::System.DateTime); } + + /// Creates an new instance. + public OperationResultContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Long Running Git Operation Results. + public partial interface IOperationResultContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation.", + SerializedName = @"actionLog", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract[] ActionLog { get; } + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of invalid fields send in request, in case of validation error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Human-readable representation of the error.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Operation result identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation result identifier.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PropertiesId { get; set; } + /// Optional result info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional result info.", + SerializedName = @"resultInfo", + PossibleTypes = new [] { typeof(string) })] + string ResultInfo { get; set; } + /// + /// Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"started", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Started { get; set; } + /// Status of an async operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of an async operation.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus? Status { get; set; } + /// + /// Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"updated", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Updated { get; set; } + + } + /// Long Running Git Operation Results. + internal partial interface IOperationResultContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract[] ActionLog { get; set; } + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Error Body Contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Error { get; set; } + /// Human-readable representation of the error. + string Message { get; set; } + /// Operation result identifier. + string PropertiesId { get; set; } + /// Properties of the Operation Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractProperties Property { get; set; } + /// Optional result info. + string ResultInfo { get; set; } + /// + /// Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + global::System.DateTime? Started { get; set; } + /// Status of an async operation. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus? Status { get; set; } + /// + /// Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? Updated { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContract.json.cs new file mode 100644 index 000000000000..d05c49766c59 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Long Running Git Operation Results. + public partial class OperationResultContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationResultContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationResultContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationResultContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContractProperties.cs new file mode 100644 index 000000000000..13b5ed371af8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContractProperties.cs @@ -0,0 +1,228 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Result. + public partial class OperationResultContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract[] _actionLog; + + /// + /// This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract[] ActionLog { get => this._actionLog; } + + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Code = value ?? null; } + + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody _error; + + /// Error Body Contract + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponseBody()); set => this._error = value; } + + /// Backing field for property. + private string _id; + + /// Operation result identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for ActionLog + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal.ActionLog { get => this._actionLog; set { {_actionLog = value;} } } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractPropertiesInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponseBody()); set { {_error = value;} } } + + /// Backing field for property. + private string _resultInfo; + + /// Optional result info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResultInfo { get => this._resultInfo; set => this._resultInfo = value; } + + /// Backing field for property. + private global::System.DateTime? _started; + + /// + /// Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? Started { get => this._started; set => this._started = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus? _status; + + /// Status of an async operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus? Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private global::System.DateTime? _updated; + + /// + /// Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? Updated { get => this._updated; set => this._updated = value; } + + /// Creates an new instance. + public OperationResultContractProperties() + { + + } + } + /// Operation Result. + public partial interface IOperationResultContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation.", + SerializedName = @"actionLog", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract[] ActionLog { get; } + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of invalid fields send in request, in case of validation error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Operation result identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation result identifier.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Human-readable representation of the error.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Optional result info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional result info.", + SerializedName = @"resultInfo", + PossibleTypes = new [] { typeof(string) })] + string ResultInfo { get; set; } + /// + /// Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"started", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Started { get; set; } + /// Status of an async operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of an async operation.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus? Status { get; set; } + /// + /// Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"updated", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Updated { get; set; } + + } + /// Operation Result. + internal partial interface IOperationResultContractPropertiesInternal + + { + /// + /// This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract[] ActionLog { get; set; } + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Error Body Contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Error { get; set; } + /// Operation result identifier. + string Id { get; set; } + /// Human-readable representation of the error. + string Message { get; set; } + /// Optional result info. + string ResultInfo { get; set; } + /// + /// Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + global::System.DateTime? Started { get; set; } + /// Status of an async operation. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus? Status { get; set; } + /// + /// Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? Updated { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContractProperties.json.cs new file mode 100644 index 000000000000..800c1284d196 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultContractProperties.json.cs @@ -0,0 +1,131 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Result. + public partial class OperationResultContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationResultContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationResultContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponseBody.FromJson(__jsonError) : Error;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_started = If( json?.PropertyT("started"), out var __jsonStarted) ? global::System.DateTime.TryParse((string)__jsonStarted, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedValue) ? __jsonStartedValue : Started : Started;} + {_updated = If( json?.PropertyT("updated"), out var __jsonUpdated) ? global::System.DateTime.TryParse((string)__jsonUpdated, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedValue) ? __jsonUpdatedValue : Updated : Updated;} + {_resultInfo = If( json?.PropertyT("resultInfo"), out var __jsonResultInfo) ? (string)__jsonResultInfo : (string)ResultInfo;} + {_actionLog = If( json?.PropertyT("actionLog"), out var __jsonActionLog) ? If( __jsonActionLog as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationResultLogItemContract.FromJson(__u) )) ))() : null : ActionLog;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._started ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._started?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "started" ,container.Add ); + AddIf( null != this._updated ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._updated?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "updated" ,container.Add ); + AddIf( null != (((object)this._resultInfo)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resultInfo.ToString()) : null, "resultInfo" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._actionLog) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._actionLog ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("actionLog",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultLogItemContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultLogItemContract.cs new file mode 100644 index 000000000000..d834aa4cb554 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultLogItemContract.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Log of the entity being created, updated or deleted. + public partial class OperationResultLogItemContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContractInternal + { + + /// Backing field for property. + private string _action; + + /// Action like create/update/delete. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Action { get => this._action; set => this._action = value; } + + /// Backing field for property. + private string _objectKey; + + /// Identifier of the entity being created/updated/deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ObjectKey { get => this._objectKey; set => this._objectKey = value; } + + /// Backing field for property. + private string _objectType; + + /// The type of entity contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Creates an new instance. + public OperationResultLogItemContract() + { + + } + } + /// Log of the entity being created, updated or deleted. + public partial interface IOperationResultLogItemContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Action like create/update/delete. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Action like create/update/delete.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(string) })] + string Action { get; set; } + /// Identifier of the entity being created/updated/deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the entity being created/updated/deleted.", + SerializedName = @"objectKey", + PossibleTypes = new [] { typeof(string) })] + string ObjectKey { get; set; } + /// The type of entity contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of entity contract.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Log of the entity being created, updated or deleted. + internal partial interface IOperationResultLogItemContractInternal + + { + /// Action like create/update/delete. + string Action { get; set; } + /// Identifier of the entity being created/updated/deleted. + string ObjectKey { get; set; } + /// The type of entity contract. + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultLogItemContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultLogItemContract.json.cs new file mode 100644 index 000000000000..aad0df7123ab --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationResultLogItemContract.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Log of the entity being created, updated or deleted. + public partial class OperationResultLogItemContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationResultLogItemContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationResultLogItemContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationResultLogItemContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} + {_objectKey = If( json?.PropertyT("objectKey"), out var __jsonObjectKey) ? (string)__jsonObjectKey : (string)ObjectKey;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AddIf( null != (((object)this._action)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._action.ToString()) : null, "action" ,container.Add ); + AddIf( null != (((object)this._objectKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._objectKey.ToString()) : null, "objectKey" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationTagResourceContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationTagResourceContractProperties.cs new file mode 100644 index 000000000000..62e4957f5535 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationTagResourceContractProperties.cs @@ -0,0 +1,203 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Entity contract Properties. + public partial class OperationTagResourceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal + { + + /// Backing field for property. + private string _apiName; + + /// API Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiName { get => this._apiName; } + + /// Backing field for property. + private string _apiRevision; + + /// API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiRevision { get => this._apiRevision; } + + /// Backing field for property. + private string _apiVersion; + + /// API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiVersion { get => this._apiVersion; } + + /// Backing field for property. + private string _description; + + /// Operation Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Backing field for property. + private string _id; + + /// Identifier of the operation in form /operations/{operationId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _method; + + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Method { get => this._method; } + + /// Internal Acessors for ApiName + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal.ApiName { get => this._apiName; set { {_apiName = value;} } } + + /// Internal Acessors for ApiRevision + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal.ApiRevision { get => this._apiRevision; set { {_apiRevision = value;} } } + + /// Internal Acessors for ApiVersion + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal.ApiVersion { get => this._apiVersion; set { {_apiVersion = value;} } } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Method + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal.Method { get => this._method; set { {_method = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for UrlTemplate + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal.UrlTemplate { get => this._urlTemplate; set { {_urlTemplate = value;} } } + + /// Backing field for property. + private string _name; + + /// Operation name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _urlTemplate; + + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UrlTemplate { get => this._urlTemplate; } + + /// Creates an new instance. + public OperationTagResourceContractProperties() + { + + } + } + /// Operation Entity contract Properties. + public partial interface IOperationTagResourceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// API Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"API Name.", + SerializedName = @"apiName", + PossibleTypes = new [] { typeof(string) })] + string ApiName { get; } + /// API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"API Revision.", + SerializedName = @"apiRevision", + PossibleTypes = new [] { typeof(string) })] + string ApiRevision { get; } + /// API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"API Version.", + SerializedName = @"apiVersion", + PossibleTypes = new [] { typeof(string) })] + string ApiVersion { get; } + /// Operation Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation Description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// Identifier of the operation in form /operations/{operationId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the operation in form /operations/{operationId}.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.", + SerializedName = @"method", + PossibleTypes = new [] { typeof(string) })] + string Method { get; } + /// Operation name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}", + SerializedName = @"urlTemplate", + PossibleTypes = new [] { typeof(string) })] + string UrlTemplate { get; } + + } + /// Operation Entity contract Properties. + internal partial interface IOperationTagResourceContractPropertiesInternal + + { + /// API Name. + string ApiName { get; set; } + /// API Revision. + string ApiRevision { get; set; } + /// API Version. + string ApiVersion { get; set; } + /// Operation Description. + string Description { get; set; } + /// Identifier of the operation in form /operations/{operationId}. + string Id { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + string Method { get; set; } + /// Operation name. + string Name { get; set; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + string UrlTemplate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationTagResourceContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationTagResourceContractProperties.json.cs new file mode 100644 index 000000000000..47e06fe84b16 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationTagResourceContractProperties.json.cs @@ -0,0 +1,144 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Entity contract Properties. + public partial class OperationTagResourceContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationTagResourceContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationTagResourceContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_apiName = If( json?.PropertyT("apiName"), out var __jsonApiName) ? (string)__jsonApiName : (string)ApiName;} + {_apiRevision = If( json?.PropertyT("apiRevision"), out var __jsonApiRevision) ? (string)__jsonApiRevision : (string)ApiRevision;} + {_apiVersion = If( json?.PropertyT("apiVersion"), out var __jsonApiVersion) ? (string)__jsonApiVersion : (string)ApiVersion;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_method = If( json?.PropertyT("method"), out var __jsonMethod) ? (string)__jsonMethod : (string)Method;} + {_urlTemplate = If( json?.PropertyT("urlTemplate"), out var __jsonUrlTemplate) ? (string)__jsonUrlTemplate : (string)UrlTemplate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._apiName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiName.ToString()) : null, "apiName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._apiRevision)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiRevision.ToString()) : null, "apiRevision" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._apiVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiVersion.ToString()) : null, "apiVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._method)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._method.ToString()) : null, "method" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._urlTemplate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._urlTemplate.ToString()) : null, "urlTemplate" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContract.cs new file mode 100644 index 000000000000..416b741831c4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContract.cs @@ -0,0 +1,217 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Operation Update Contract details. + public partial class OperationUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractInternal + { + + /// Description of the operation. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Description = value ?? null; } + + /// Operation Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Method { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractPropertiesInternal)Property).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractPropertiesInternal)Property).Method = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationUpdateContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Request + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractInternal.Request { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Request = value; } + + /// Operation Policies + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Policy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Policy = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractProperties _property; + + /// Properties of the API Operation entity that can be updated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationUpdateContractProperties()); set => this._property = value; } + + /// Operation request description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string RequestDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestDescription = value ?? null; } + + /// Collection of operation request headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestHeader = value ?? null /* arrayOf */; } + + /// Collection of operation request query parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestQueryParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestQueryParameter = value ?? null /* arrayOf */; } + + /// Collection of operation request representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestRepresentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).RequestRepresentation = value ?? null /* arrayOf */; } + + /// Array of Operation responses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).Response = value ?? null /* arrayOf */; } + + /// Collection of URL template parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).TemplateParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)Property).TemplateParameter = value ?? null /* arrayOf */; } + + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string UrlTemplate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractPropertiesInternal)Property).UrlTemplate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractPropertiesInternal)Property).UrlTemplate = value ?? null; } + + /// Creates an new instance. + public OperationUpdateContract() + { + + } + } + /// API Operation Update Contract details. + public partial interface IOperationUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of the operation. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Operation Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation Name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.", + SerializedName = @"method", + PossibleTypes = new [] { typeof(string) })] + string Method { get; set; } + /// Operation Policies + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation Policies", + SerializedName = @"policies", + PossibleTypes = new [] { typeof(string) })] + string Policy { get; set; } + /// Operation request description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation request description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string RequestDescription { get; set; } + /// Collection of operation request headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request headers.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get; set; } + /// Collection of operation request query parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request query parameters.", + SerializedName = @"queryParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get; set; } + /// Collection of operation request representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request representations.", + SerializedName = @"representations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get; set; } + /// Array of Operation responses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of Operation responses.", + SerializedName = @"responses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get; set; } + /// Collection of URL template parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of URL template parameters.", + SerializedName = @"templateParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get; set; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}", + SerializedName = @"urlTemplate", + PossibleTypes = new [] { typeof(string) })] + string UrlTemplate { get; set; } + + } + /// API Operation Update Contract details. + internal partial interface IOperationUpdateContractInternal + + { + /// Description of the operation. May include HTML formatting tags. + string Description { get; set; } + /// Operation Name. + string DisplayName { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + string Method { get; set; } + /// Operation Policies + string Policy { get; set; } + /// Properties of the API Operation entity that can be updated. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractProperties Property { get; set; } + /// An entity containing request details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract Request { get; set; } + /// Operation request description. + string RequestDescription { get; set; } + /// Collection of operation request headers. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get; set; } + /// Collection of operation request query parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get; set; } + /// Collection of operation request representations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get; set; } + /// Array of Operation responses. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get; set; } + /// Collection of URL template parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get; set; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + string UrlTemplate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContract.json.cs new file mode 100644 index 000000000000..aa05dd7c14fd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Operation Update Contract details. + public partial class OperationUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationUpdateContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationUpdateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContractProperties.cs new file mode 100644 index 000000000000..d3f5e0b004fb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContractProperties.cs @@ -0,0 +1,152 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Update Contract Properties. + public partial class OperationUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContract __operationEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationEntityBaseContract(); + + /// Description of the operation. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// Operation Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _method; + + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Method { get => this._method; set => this._method = value; } + + /// Operation Policies + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Policy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Policy = value ?? null; } + + /// An entity containing request details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract Request { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Request = value ?? null /* model class */; } + + /// Operation request description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string RequestDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestDescription = value ?? null; } + + /// Collection of operation request headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestHeader = value ?? null /* arrayOf */; } + + /// Collection of operation request query parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] RequestQueryParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestQueryParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestQueryParameter = value ?? null /* arrayOf */; } + + /// Collection of operation request representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] RequestRepresentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestRepresentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).RequestRepresentation = value ?? null /* arrayOf */; } + + /// Array of Operation responses. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract[] Response { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Response; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).Response = value ?? null /* arrayOf */; } + + /// Collection of URL template parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] TemplateParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).TemplateParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal)__operationEntityBaseContract).TemplateParameter = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _urlTemplate; + + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UrlTemplate { get => this._urlTemplate; set => this._urlTemplate = value; } + + /// Creates an new instance. + public OperationUpdateContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__operationEntityBaseContract), __operationEntityBaseContract); + await eventListener.AssertObjectIsValid(nameof(__operationEntityBaseContract), __operationEntityBaseContract); + } + } + /// Operation Update Contract Properties. + public partial interface IOperationUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContract + { + /// Operation Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation Name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.", + SerializedName = @"method", + PossibleTypes = new [] { typeof(string) })] + string Method { get; set; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}", + SerializedName = @"urlTemplate", + PossibleTypes = new [] { typeof(string) })] + string UrlTemplate { get; set; } + + } + /// Operation Update Contract Properties. + internal partial interface IOperationUpdateContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationEntityBaseContractInternal + { + /// Operation Name. + string DisplayName { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + string Method { get; set; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + string UrlTemplate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContractProperties.json.cs new file mode 100644 index 000000000000..cdaa69aa27d9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OperationUpdateContractProperties.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation Update Contract Properties. + public partial class OperationUpdateContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationUpdateContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OperationUpdateContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OperationUpdateContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __operationEntityBaseContract = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationEntityBaseContract(json); + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_method = If( json?.PropertyT("method"), out var __jsonMethod) ? (string)__jsonMethod : (string)Method;} + {_urlTemplate = If( json?.PropertyT("urlTemplate"), out var __jsonUrlTemplate) ? (string)__jsonUrlTemplate : (string)UrlTemplate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __operationEntityBaseContract?.ToJson(container, serializationMode); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._method)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._method.ToString()) : null, "method" ,container.Add ); + AddIf( null != (((object)this._urlTemplate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._urlTemplate.ToString()) : null, "urlTemplate" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpoint.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpoint.cs new file mode 100644 index 000000000000..b82ef7b45fc2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpoint.cs @@ -0,0 +1,79 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Endpoints accessed for a common purpose that the Api Management Service requires outbound network access to. + /// + public partial class OutboundEnvironmentEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpointInternal + { + + /// Backing field for property. + private string _category; + + /// + /// The type of service accessed by the Api Management Service, e.g., Azure Storage, Azure SQL Database, and Azure Active + /// Directory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Category { get => this._category; set => this._category = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependency[] _endpoint; + + /// The endpoints that the Api Management Service reaches the service at. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependency[] Endpoint { get => this._endpoint; set => this._endpoint = value; } + + /// Creates an new instance. + public OutboundEnvironmentEndpoint() + { + + } + } + /// Endpoints accessed for a common purpose that the Api Management Service requires outbound network access to. + public partial interface IOutboundEnvironmentEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The type of service accessed by the Api Management Service, e.g., Azure Storage, Azure SQL Database, and Azure Active + /// Directory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of service accessed by the Api Management Service, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory.", + SerializedName = @"category", + PossibleTypes = new [] { typeof(string) })] + string Category { get; set; } + /// The endpoints that the Api Management Service reaches the service at. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The endpoints that the Api Management Service reaches the service at.", + SerializedName = @"endpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependency) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependency[] Endpoint { get; set; } + + } + /// Endpoints accessed for a common purpose that the Api Management Service requires outbound network access to. + internal partial interface IOutboundEnvironmentEndpointInternal + + { + /// + /// The type of service accessed by the Api Management Service, e.g., Azure Storage, Azure SQL Database, and Azure Active + /// Directory. + /// + string Category { get; set; } + /// The endpoints that the Api Management Service reaches the service at. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependency[] Endpoint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpoint.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpoint.json.cs new file mode 100644 index 000000000000..a6c1e8036bf6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpoint.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// + /// Endpoints accessed for a common purpose that the Api Management Service requires outbound network access to. + /// + public partial class OutboundEnvironmentEndpoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OutboundEnvironmentEndpoint(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OutboundEnvironmentEndpoint(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} + {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? If( __jsonEndpoints as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IEndpointDependency) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.EndpointDependency.FromJson(__u) )) ))() : null : Endpoint;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._category.ToString()) : null, "category" ,container.Add ); + if (null != this._endpoint) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._endpoint ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("endpoints",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpointList.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpointList.cs new file mode 100644 index 000000000000..29d26cbf9841 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpointList.cs @@ -0,0 +1,71 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Collection of Outbound Environment Endpoints + public partial class OutboundEnvironmentEndpointList : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpointList, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpointListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpointListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to next page of resources. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpoint[] _value; + + /// Collection of resources. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpoint[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public OutboundEnvironmentEndpointList() + { + + } + } + /// Collection of Outbound Environment Endpoints + public partial interface IOutboundEnvironmentEndpointList : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Link to next page of resources. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to next page of resources.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Collection of resources. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Collection of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpoint) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpoint[] Value { get; set; } + + } + /// Collection of Outbound Environment Endpoints + internal partial interface IOutboundEnvironmentEndpointListInternal + + { + /// Link to next page of resources. + string NextLink { get; set; } + /// Collection of resources. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpoint[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpointList.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpointList.json.cs new file mode 100644 index 000000000000..4a4083117a70 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/OutboundEnvironmentEndpointList.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Collection of Outbound Environment Endpoints + public partial class OutboundEnvironmentEndpointList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpointList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpointList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpointList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OutboundEnvironmentEndpointList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OutboundEnvironmentEndpointList(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOutboundEnvironmentEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OutboundEnvironmentEndpoint.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterContract.cs new file mode 100644 index 000000000000..25c14556eef1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterContract.cs @@ -0,0 +1,187 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation parameters details. + public partial class ParameterContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContractInternal + { + + /// Backing field for property. + private string _defaultValue; + + /// Default parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DefaultValue { get => this._defaultValue; set => this._defaultValue = value; } + + /// Backing field for property. + private string _description; + + /// Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract _example; + + /// Exampled defined for the parameter. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract Example { get => (this._example = this._example ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterExamplesContract()); set => this._example = value; } + + /// Backing field for property. + private string _name; + + /// Parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private bool? _required; + + /// Specifies whether parameter is required or not. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Required { get => this._required; set => this._required = value; } + + /// Backing field for property. + private string _schemaId; + + /// Schema identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SchemaId { get => this._schemaId; set => this._schemaId = value; } + + /// Backing field for property. + private string _type; + + /// Parameter type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private string _typeName; + + /// Type name defined by the schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TypeName { get => this._typeName; set => this._typeName = value; } + + /// Backing field for property. + private string[] _value; + + /// Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ParameterContract() + { + + } + } + /// Operation parameters details. + public partial interface IParameterContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Default parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default parameter value.", + SerializedName = @"defaultValue", + PossibleTypes = new [] { typeof(string) })] + string DefaultValue { get; set; } + /// Parameter description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parameter description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Exampled defined for the parameter. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Exampled defined for the parameter.", + SerializedName = @"examples", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract Example { get; set; } + /// Parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Parameter name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Specifies whether parameter is required or not. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether parameter is required or not.", + SerializedName = @"required", + PossibleTypes = new [] { typeof(bool) })] + bool? Required { get; set; } + /// Schema identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Schema identifier.", + SerializedName = @"schemaId", + PossibleTypes = new [] { typeof(string) })] + string SchemaId { get; set; } + /// Parameter type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Parameter type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + /// Type name defined by the schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type name defined by the schema.", + SerializedName = @"typeName", + PossibleTypes = new [] { typeof(string) })] + string TypeName { get; set; } + /// Parameter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parameter values.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// Operation parameters details. + internal partial interface IParameterContractInternal + + { + /// Default parameter value. + string DefaultValue { get; set; } + /// Parameter description. + string Description { get; set; } + /// Exampled defined for the parameter. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract Example { get; set; } + /// Parameter name. + string Name { get; set; } + /// Specifies whether parameter is required or not. + bool? Required { get; set; } + /// Schema identifier. + string SchemaId { get; set; } + /// Parameter type. + string Type { get; set; } + /// Type name defined by the schema. + string TypeName { get; set; } + /// Parameter values. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterContract.json.cs new file mode 100644 index 000000000000..9f2de9165321 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterContract.json.cs @@ -0,0 +1,132 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation parameters details. + public partial class ParameterContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ParameterContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ParameterContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_defaultValue = If( json?.PropertyT("defaultValue"), out var __jsonDefaultValue) ? (string)__jsonDefaultValue : (string)DefaultValue;} + {_required = If( json?.PropertyT("required"), out var __jsonRequired) ? (bool?)__jsonRequired : Required;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + {_schemaId = If( json?.PropertyT("schemaId"), out var __jsonSchemaId) ? (string)__jsonSchemaId : (string)SchemaId;} + {_typeName = If( json?.PropertyT("typeName"), out var __jsonTypeName) ? (string)__jsonTypeName : (string)TypeName;} + {_example = If( json?.PropertyT("examples"), out var __jsonExamples) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterExamplesContract.FromJson(__jsonExamples) : Example;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._defaultValue)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._defaultValue.ToString()) : null, "defaultValue" ,container.Add ); + AddIf( null != this._required ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._required) : null, "required" ,container.Add ); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AddIf( null != (((object)this._schemaId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._schemaId.ToString()) : null, "schemaId" ,container.Add ); + AddIf( null != (((object)this._typeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._typeName.ToString()) : null, "typeName" ,container.Add ); + AddIf( null != this._example ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._example.ToJson(null,serializationMode) : null, "examples" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExampleContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExampleContract.cs new file mode 100644 index 000000000000..43082046cc10 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExampleContract.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameter example. + public partial class ParameterExampleContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExampleContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExampleContractInternal + { + + /// Backing field for property. + private string _description; + + /// Long description for the example + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _externalValue; + + /// A URL that points to the literal example + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ExternalValue { get => this._externalValue; set => this._externalValue = value; } + + /// Backing field for property. + private string _summary; + + /// Short description for the example + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Summary { get => this._summary; set => this._summary = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny _value; + + /// Example value. May be a primitive value, or an object. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any()); set => this._value = value; } + + /// Creates an new instance. + public ParameterExampleContract() + { + + } + } + /// Parameter example. + public partial interface IParameterExampleContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Long description for the example + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Long description for the example", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// A URL that points to the literal example + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A URL that points to the literal example", + SerializedName = @"externalValue", + PossibleTypes = new [] { typeof(string) })] + string ExternalValue { get; set; } + /// Short description for the example + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Short description for the example", + SerializedName = @"summary", + PossibleTypes = new [] { typeof(string) })] + string Summary { get; set; } + /// Example value. May be a primitive value, or an object. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Example value. May be a primitive value, or an object.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Value { get; set; } + + } + /// Parameter example. + internal partial interface IParameterExampleContractInternal + + { + /// Long description for the example + string Description { get; set; } + /// A URL that points to the literal example + string ExternalValue { get; set; } + /// Short description for the example + string Summary { get; set; } + /// Example value. May be a primitive value, or an object. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExampleContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExampleContract.json.cs new file mode 100644 index 000000000000..0a10f8603178 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExampleContract.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameter example. + public partial class ParameterExampleContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExampleContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExampleContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExampleContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ParameterExampleContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ParameterExampleContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_summary = If( json?.PropertyT("summary"), out var __jsonSummary) ? (string)__jsonSummary : (string)Summary;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any.FromJson(__jsonValue) : Value;} + {_externalValue = If( json?.PropertyT("externalValue"), out var __jsonExternalValue) ? (string)__jsonExternalValue : (string)ExternalValue;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._summary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._summary.ToString()) : null, "summary" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._value.ToJson(null,serializationMode) : null, "value" ,container.Add ); + AddIf( null != (((object)this._externalValue)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._externalValue.ToString()) : null, "externalValue" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExamplesContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExamplesContract.cs new file mode 100644 index 000000000000..d399f1d3d510 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExamplesContract.cs @@ -0,0 +1,35 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameter examples. + public partial class ParameterExamplesContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContractInternal + { + + /// Creates an new instance. + public ParameterExamplesContract() + { + + } + } + /// Parameter examples. + public partial interface IParameterExamplesContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// Parameter examples. + internal partial interface IParameterExamplesContractInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExamplesContract.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExamplesContract.dictionary.cs new file mode 100644 index 000000000000..b0191e85e98c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExamplesContract.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ParameterExamplesContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExampleContract this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExampleContract value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExampleContract value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterExamplesContract source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExamplesContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExamplesContract.json.cs new file mode 100644 index 000000000000..9830caedbc95 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ParameterExamplesContract.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameter examples. + public partial class ParameterExamplesContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ParameterExamplesContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ParameterExamplesContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterExampleContract.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PipelineDiagnosticSettings.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PipelineDiagnosticSettings.cs new file mode 100644 index 000000000000..1dbebf37d0fb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PipelineDiagnosticSettings.cs @@ -0,0 +1,190 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + public partial class PipelineDiagnosticSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal + { + + /// Internal Acessors for Request + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal.Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.HttpMessageDiagnostic()); set { {_request = value;} } } + + /// Internal Acessors for RequestBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal.RequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).Body; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).Body = value; } + + /// Internal Acessors for RequestDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal.RequestDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).DataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).DataMasking = value; } + + /// Internal Acessors for Response + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal.Response { get => (this._response = this._response ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.HttpMessageDiagnostic()); set { {_response = value;} } } + + /// Internal Acessors for ResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal.ResponseBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).Body; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).Body = value; } + + /// Internal Acessors for ResponseDataMasking + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettingsInternal.ResponseDataMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).DataMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).DataMasking = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic _request; + + /// Diagnostic settings for request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.HttpMessageDiagnostic()); set => this._request = value; } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? RequestBodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).BodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).BodyByte = value ?? default(int); } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] RequestDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).DataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).DataMaskingHeader = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] RequestDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).DataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).DataMaskingQueryParam = value ?? null /* arrayOf */; } + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Request).Header = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic _response; + + /// Diagnostic settings for response. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Response { get => (this._response = this._response ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.HttpMessageDiagnostic()); set => this._response = value; } + + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? ResponseBodyByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).BodyByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).BodyByte = value ?? default(int); } + + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] ResponseDataMaskingHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).DataMaskingHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).DataMaskingHeader = value ?? null /* arrayOf */; } + + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] ResponseDataMaskingQueryParam { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).DataMaskingQueryParam; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).DataMaskingQueryParam = value ?? null /* arrayOf */; } + + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] ResponseHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnosticInternal)Response).Header = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public PipelineDiagnosticSettings() + { + + } + } + /// Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + public partial interface IPipelineDiagnosticSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? RequestBodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] RequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] RequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] RequestHeader { get; set; } + /// Number of request body bytes to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of request body bytes to log.", + SerializedName = @"bytes", + PossibleTypes = new [] { typeof(int) })] + int? ResponseBodyByte { get; set; } + /// Masking settings for headers + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for headers", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] ResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Masking settings for Url query parameters", + SerializedName = @"queryParams", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] ResponseDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of HTTP Headers to log.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(string) })] + string[] ResponseHeader { get; set; } + + } + /// Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + internal partial interface IPipelineDiagnosticSettingsInternal + + { + /// Diagnostic settings for request. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Request { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings RequestBody { get; set; } + /// Number of request body bytes to log. + int? RequestBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking RequestDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] RequestDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] RequestDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] RequestHeader { get; set; } + /// Diagnostic settings for response. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IHttpMessageDiagnostic Response { get; set; } + /// Body logging settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IBodyDiagnosticSettings ResponseBody { get; set; } + /// Number of request body bytes to log. + int? ResponseBodyByte { get; set; } + /// Data masking settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMasking ResponseDataMasking { get; set; } + /// Masking settings for headers + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] ResponseDataMaskingHeader { get; set; } + /// Masking settings for Url query parameters + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IDataMaskingEntity[] ResponseDataMaskingQueryParam { get; set; } + /// Array of HTTP Headers to log. + string[] ResponseHeader { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PipelineDiagnosticSettings.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PipelineDiagnosticSettings.json.cs new file mode 100644 index 000000000000..824b7f67ac77 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PipelineDiagnosticSettings.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + public partial class PipelineDiagnosticSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPipelineDiagnosticSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PipelineDiagnosticSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PipelineDiagnosticSettings(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_request = If( json?.PropertyT("request"), out var __jsonRequest) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.HttpMessageDiagnostic.FromJson(__jsonRequest) : Request;} + {_response = If( json?.PropertyT("response"), out var __jsonResponse) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.HttpMessageDiagnostic.FromJson(__jsonResponse) : Response;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._request ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._request.ToJson(null,serializationMode) : null, "request" ,container.Add ); + AddIf( null != this._response ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._response.ToJson(null,serializationMode) : null, "response" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyCollection.cs new file mode 100644 index 000000000000..3dc16c7b9129 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the list policy operation. + public partial class PolicyCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract[] _value; + + /// Policy Contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PolicyCollection() + { + + } + } + /// The response of the list policy operation. + public partial interface IPolicyCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Policy Contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Contract value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract[] Value { get; set; } + + } + /// The response of the list policy operation. + internal partial interface IPolicyCollectionInternal + + { + /// Total record count number. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Policy Contract value. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyCollection.json.cs new file mode 100644 index 000000000000..e54141971f9c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the list policy operation. + public partial class PolicyCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContract.cs new file mode 100644 index 000000000000..ec2fc27c64e2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContract.cs @@ -0,0 +1,141 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy Contract details. + public partial class PolicyContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Format of the policyContent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat? Format { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractPropertiesInternal)Property).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractPropertiesInternal)Property).Format = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat)""); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractProperties _property; + + /// Properties of the Policy. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Contents of the Policy as defined by the format. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractPropertiesInternal)Property).Value = value ?? null; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public PolicyContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Policy Contract details. + public partial interface IPolicyContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Format of the policyContent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Format of the policyContent.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat? Format { get; set; } + /// Contents of the Policy as defined by the format. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Contents of the Policy as defined by the format.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Policy Contract details. + internal partial interface IPolicyContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Format of the policyContent. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat? Format { get; set; } + /// Properties of the Policy. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractProperties Property { get; set; } + /// Contents of the Policy as defined by the format. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContract.json.cs new file mode 100644 index 000000000000..b12a27173c87 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy Contract details. + public partial class PolicyContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContractProperties.cs new file mode 100644 index 000000000000..ad281c9e8c9e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContractProperties.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy contract Properties. + public partial class PolicyContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat? _format; + + /// Format of the policyContent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat? Format { get => this._format; set => this._format = value; } + + /// Backing field for property. + private string _value; + + /// Contents of the Policy as defined by the format. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PolicyContractProperties() + { + + } + } + /// Policy contract Properties. + public partial interface IPolicyContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Format of the policyContent. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Format of the policyContent.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat? Format { get; set; } + /// Contents of the Policy as defined by the format. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Contents of the Policy as defined by the format.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Policy contract Properties. + internal partial interface IPolicyContractPropertiesInternal + + { + /// Format of the policyContent. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat? Format { get; set; } + /// Contents of the Policy as defined by the format. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContractProperties.json.cs new file mode 100644 index 000000000000..211acd66610c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyContractProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy contract Properties. + public partial class PolicyContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_format = If( json?.PropertyT("format"), out var __jsonFormat) ? (string)__jsonFormat : (string)Format;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != (((object)this._format)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._format.ToString()) : null, "format" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionCollection.cs new file mode 100644 index 000000000000..f37039f8a8f1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionCollection.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Descriptions of API Management policies. + public partial class PolicyDescriptionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContract[] _value; + + /// Descriptions of API Management policies. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PolicyDescriptionCollection() + { + + } + } + /// Descriptions of API Management policies. + public partial interface IPolicyDescriptionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Descriptions of API Management policies. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Descriptions of API Management policies.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContract[] Value { get; set; } + + } + /// Descriptions of API Management policies. + internal partial interface IPolicyDescriptionCollectionInternal + + { + /// Total record count number. + long? Count { get; set; } + /// Descriptions of API Management policies. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionCollection.json.cs new file mode 100644 index 000000000000..232b8d631f9f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionCollection.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Descriptions of API Management policies. + public partial class PolicyDescriptionCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyDescriptionCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyDescriptionCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyDescriptionContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContract.cs new file mode 100644 index 000000000000..0fb12abc09b8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContract.cs @@ -0,0 +1,123 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy description details. + public partial class PolicyDescriptionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Policy description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractPropertiesInternal)Property).Description; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractPropertiesInternal)Property).Description = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyDescriptionContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Scope + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractPropertiesInternal)Property).Scope = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractProperties _property; + + /// Policy description contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyDescriptionContractProperties()); set => this._property = value; } + + /// Binary OR value of the Snippet scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public long? Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractPropertiesInternal)Property).Scope; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public PolicyDescriptionContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Policy description details. + public partial interface IPolicyDescriptionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Policy description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Policy description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// Binary OR value of the Snippet scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Binary OR value of the Snippet scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(long) })] + long? Scope { get; } + + } + /// Policy description details. + internal partial interface IPolicyDescriptionContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Policy description. + string Description { get; set; } + /// Policy description contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractProperties Property { get; set; } + /// Binary OR value of the Snippet scope. + long? Scope { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContract.json.cs new file mode 100644 index 000000000000..3dd678e1566c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy description details. + public partial class PolicyDescriptionContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyDescriptionContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyDescriptionContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyDescriptionContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContractProperties.cs new file mode 100644 index 000000000000..3a3485ac1a88 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContractProperties.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy description properties. + public partial class PolicyDescriptionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Policy description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Scope + long? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + + /// Backing field for property. + private long? _scope; + + /// Binary OR value of the Snippet scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Scope { get => this._scope; } + + /// Creates an new instance. + public PolicyDescriptionContractProperties() + { + + } + } + /// Policy description properties. + public partial interface IPolicyDescriptionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Policy description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Policy description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// Binary OR value of the Snippet scope. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Binary OR value of the Snippet scope.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(long) })] + long? Scope { get; } + + } + /// Policy description properties. + internal partial interface IPolicyDescriptionContractPropertiesInternal + + { + /// Policy description. + string Description { get; set; } + /// Binary OR value of the Snippet scope. + long? Scope { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContractProperties.json.cs new file mode 100644 index 000000000000..515665ff0314 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyDescriptionContractProperties.json.cs @@ -0,0 +1,117 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy description properties. + public partial class PolicyDescriptionContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyDescriptionContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyDescriptionContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyDescriptionContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (long?)__jsonScope : Scope;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._scope ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._scope) : null, "scope" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentCollection.cs new file mode 100644 index 000000000000..ef969694a4b6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the get policy fragments operation. + public partial class PolicyFragmentCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract[] _value; + + /// Policy fragment contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PolicyFragmentCollection() + { + + } + } + /// The response of the get policy fragments operation. + public partial interface IPolicyFragmentCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Policy fragment contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy fragment contract value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract[] Value { get; set; } + + } + /// The response of the get policy fragments operation. + internal partial interface IPolicyFragmentCollectionInternal + + { + /// Total record count number. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Policy fragment contract value. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentCollection.json.cs new file mode 100644 index 000000000000..34545db26533 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the get policy fragments operation. + public partial class PolicyFragmentCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyFragmentCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyFragmentCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyFragmentContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContract.cs new file mode 100644 index 000000000000..d2b59171091b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContract.cs @@ -0,0 +1,212 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy fragment contract details. + public partial class PolicyFragmentContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Policy fragment description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal)Property).Description = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Format of the policy fragment content. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? Format { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal)Property).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal)Property).Format = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat)""); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyFragmentContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal)Property).ProvisioningState = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractProperties _property; + + /// Properties of the Policy Fragment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyFragmentContractProperties()); set => this._property = value; } + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal)Property).ProvisioningState; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Contents of the policy fragment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Value { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal)Property).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal)Property).Value = value ?? null; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + if (headers.TryGetValues("location", out var __locationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader1) is string __headerLocationHeader1 ? __headerLocationHeader1 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader2)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader2) is string __headerAzureAsyncOperationHeader2 ? __headerAzureAsyncOperationHeader2 : (string)null; + } + } + + /// Creates an new instance. + public PolicyFragmentContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Policy fragment contract details. + public partial interface IPolicyFragmentContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + /// Policy fragment description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy fragment description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Format of the policy fragment content. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Format of the policy fragment content.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? Format { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Contents of the policy fragment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Contents of the policy fragment.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Policy fragment contract details. + internal partial interface IPolicyFragmentContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string AzureAsyncOperation { get; set; } + /// Policy fragment description. + string Description { get; set; } + + string ETag { get; set; } + /// Format of the policy fragment content. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? Format { get; set; } + + string Location { get; set; } + /// Properties of the Policy Fragment. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractProperties Property { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// Contents of the policy fragment. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContract.json.cs new file mode 100644 index 000000000000..4d16cf9e0034 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy fragment contract details. + public partial class PolicyFragmentContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyFragmentContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyFragmentContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyFragmentContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContractProperties.cs new file mode 100644 index 000000000000..30fbaeabe0d2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContractProperties.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy fragment contract properties. + public partial class PolicyFragmentContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Policy fragment description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? _format; + + /// Format of the policy fragment content. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? Format { get => this._format; set => this._format = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _value; + + /// Contents of the policy fragment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PolicyFragmentContractProperties() + { + + } + } + /// Policy fragment contract properties. + public partial interface IPolicyFragmentContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Policy fragment description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy fragment description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Format of the policy fragment content. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Format of the policy fragment content.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? Format { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Contents of the policy fragment. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Contents of the policy fragment.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Policy fragment contract properties. + internal partial interface IPolicyFragmentContractPropertiesInternal + + { + /// Policy fragment description. + string Description { get; set; } + /// Format of the policy fragment content. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat? Format { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// Contents of the policy fragment. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContractProperties.json.cs new file mode 100644 index 000000000000..add0f7f616ac --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyFragmentContractProperties.json.cs @@ -0,0 +1,117 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy fragment contract properties. + public partial class PolicyFragmentContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyFragmentContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyFragmentContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyFragmentContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_format = If( json?.PropertyT("format"), out var __jsonFormat) ? (string)__jsonFormat : (string)Format;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._format)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._format.ToString()) : null, "format" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionCollection.cs new file mode 100644 index 000000000000..4e440c4205ea --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionCollection.cs @@ -0,0 +1,67 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the get policy restrictions operation. + public partial class PolicyRestrictionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionCollectionInternal + { + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract[] _value; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PolicyRestrictionCollection() + { + + } + } + /// The response of the get policy restrictions operation. + public partial interface IPolicyRestrictionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract[] Value { get; set; } + + } + /// The response of the get policy restrictions operation. + internal partial interface IPolicyRestrictionCollectionInternal + + { + /// Next page link if any. + string NextLink { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionCollection.json.cs new file mode 100644 index 000000000000..f560a56f4977 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionCollection.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the get policy restrictions operation. + public partial class PolicyRestrictionCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyRestrictionCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyRestrictionCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContract.cs new file mode 100644 index 000000000000..3b586306a519 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContract.cs @@ -0,0 +1,141 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy restriction contract details. + public partial class PolicyRestrictionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties _property; + + /// Properties of the Policy Restriction. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContractProperties()); set => this._property = value; } + + /// Indicates if base policy should be enforced for the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase? RequireBase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractPropertiesInternal)Property).RequireBase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractPropertiesInternal)Property).RequireBase = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase)""); } + + /// Path to the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractPropertiesInternal)Property).Scope = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public PolicyRestrictionContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Policy restriction contract details. + public partial interface IPolicyRestrictionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Indicates if base policy should be enforced for the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if base policy should be enforced for the policy document.", + SerializedName = @"requireBase", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase? RequireBase { get; set; } + /// Path to the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Path to the policy document.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + + } + /// Policy restriction contract details. + internal partial interface IPolicyRestrictionContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Properties of the Policy Restriction. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties Property { get; set; } + /// Indicates if base policy should be enforced for the policy document. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase? RequireBase { get; set; } + /// Path to the policy document. + string Scope { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContract.json.cs new file mode 100644 index 000000000000..32201dfd0a3e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy restriction contract details. + public partial class PolicyRestrictionContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyRestrictionContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyRestrictionContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContractProperties.cs new file mode 100644 index 000000000000..fb13006f848f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContractProperties.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy restrictions contract properties. + public partial class PolicyRestrictionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase? _requireBase; + + /// Indicates if base policy should be enforced for the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase? RequireBase { get => this._requireBase; set => this._requireBase = value; } + + /// Backing field for property. + private string _scope; + + /// Path to the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Creates an new instance. + public PolicyRestrictionContractProperties() + { + + } + } + /// Policy restrictions contract properties. + public partial interface IPolicyRestrictionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Indicates if base policy should be enforced for the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if base policy should be enforced for the policy document.", + SerializedName = @"requireBase", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase? RequireBase { get; set; } + /// Path to the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Path to the policy document.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + + } + /// Policy restrictions contract properties. + internal partial interface IPolicyRestrictionContractPropertiesInternal + + { + /// Indicates if base policy should be enforced for the policy document. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase? RequireBase { get; set; } + /// Path to the policy document. + string Scope { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContractProperties.json.cs new file mode 100644 index 000000000000..5ca9ddeef6be --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionContractProperties.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy restrictions contract properties. + public partial class PolicyRestrictionContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyRestrictionContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyRestrictionContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_requireBase = If( json?.PropertyT("requireBase"), out var __jsonRequireBase) ? (string)__jsonRequireBase : (string)RequireBase;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + AddIf( null != (((object)this._requireBase)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._requireBase.ToString()) : null, "requireBase" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionUpdateContract.cs new file mode 100644 index 000000000000..4ef210e6cae3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionUpdateContract.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy restriction contract details. + public partial class PolicyRestrictionUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionUpdateContractInternal + { + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties _property; + + /// Properties of the Policy Restriction. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContractProperties()); set => this._property = value; } + + /// Indicates if base policy should be enforced for the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase? RequireBase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractPropertiesInternal)Property).RequireBase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractPropertiesInternal)Property).RequireBase = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase)""); } + + /// Path to the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractPropertiesInternal)Property).Scope = value ?? null; } + + /// Creates an new instance. + public PolicyRestrictionUpdateContract() + { + + } + } + /// Policy restriction contract details. + public partial interface IPolicyRestrictionUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Indicates if base policy should be enforced for the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if base policy should be enforced for the policy document.", + SerializedName = @"requireBase", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase? RequireBase { get; set; } + /// Path to the policy document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Path to the policy document.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + + } + /// Policy restriction contract details. + internal partial interface IPolicyRestrictionUpdateContractInternal + + { + /// Properties of the Policy Restriction. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionContractProperties Property { get; set; } + /// Indicates if base policy should be enforced for the policy document. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase? RequireBase { get; set; } + /// Path to the policy document. + string Scope { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionUpdateContract.json.cs new file mode 100644 index 000000000000..58b53399714b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyRestrictionUpdateContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy restriction contract details. + public partial class PolicyRestrictionUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyRestrictionUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyRestrictionUpdateContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyRestrictionUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyRestrictionContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceCollection.cs new file mode 100644 index 000000000000..df2379d4f7a8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceCollection.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the list policy operation. + public partial class PolicyWithComplianceCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceCollectionInternal + { + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContract[] _value; + + /// Policy Contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PolicyWithComplianceCollection() + { + + } + } + /// The response of the list policy operation. + public partial interface IPolicyWithComplianceCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Policy Contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Contract value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContract[] Value { get; set; } + + } + /// The response of the list policy operation. + internal partial interface IPolicyWithComplianceCollectionInternal + + { + /// Next page link if any. + string NextLink { get; set; } + /// Policy Contract value. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceCollection.json.cs new file mode 100644 index 000000000000..d0d1a2cf4379 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceCollection.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the list policy operation. + public partial class PolicyWithComplianceCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyWithComplianceCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyWithComplianceCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyWithComplianceContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContract.cs new file mode 100644 index 000000000000..50313e42fa0c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContract.cs @@ -0,0 +1,117 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy Contract details. + public partial class PolicyWithComplianceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Policy Restriction Compliance State + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractPropertiesInternal)Property).ComplianceState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractPropertiesInternal)Property).ComplianceState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState)""); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyWithComplianceContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractProperties _property; + + /// Properties of the Policy. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyWithComplianceContractProperties()); set => this._property = value; } + + /// Policy Identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ReferencePolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractPropertiesInternal)Property).ReferencePolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractPropertiesInternal)Property).ReferencePolicyId = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public PolicyWithComplianceContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Policy Contract details. + public partial interface IPolicyWithComplianceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Policy Restriction Compliance State + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Restriction Compliance State", + SerializedName = @"complianceState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get; set; } + /// Policy Identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Identifier", + SerializedName = @"referencePolicyId", + PossibleTypes = new [] { typeof(string) })] + string ReferencePolicyId { get; set; } + + } + /// Policy Contract details. + internal partial interface IPolicyWithComplianceContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Policy Restriction Compliance State + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get; set; } + /// Properties of the Policy. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractProperties Property { get; set; } + /// Policy Identifier + string ReferencePolicyId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContract.json.cs new file mode 100644 index 000000000000..7ba8ea71f6ce --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy Contract details. + public partial class PolicyWithComplianceContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyWithComplianceContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyWithComplianceContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PolicyWithComplianceContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContractProperties.cs new file mode 100644 index 000000000000..3547f618071c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContractProperties.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy contract Properties. + public partial class PolicyWithComplianceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? _complianceState; + + /// Policy Restriction Compliance State + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get => this._complianceState; set => this._complianceState = value; } + + /// Backing field for property. + private string _referencePolicyId; + + /// Policy Identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ReferencePolicyId { get => this._referencePolicyId; set => this._referencePolicyId = value; } + + /// Creates an new instance. + public PolicyWithComplianceContractProperties() + { + + } + } + /// Policy contract Properties. + public partial interface IPolicyWithComplianceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Policy Restriction Compliance State + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Restriction Compliance State", + SerializedName = @"complianceState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get; set; } + /// Policy Identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy Identifier", + SerializedName = @"referencePolicyId", + PossibleTypes = new [] { typeof(string) })] + string ReferencePolicyId { get; set; } + + } + /// Policy contract Properties. + internal partial interface IPolicyWithComplianceContractPropertiesInternal + + { + /// Policy Restriction Compliance State + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState? ComplianceState { get; set; } + /// Policy Identifier + string ReferencePolicyId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContractProperties.json.cs new file mode 100644 index 000000000000..64d9570da3f2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PolicyWithComplianceContractProperties.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Policy contract Properties. + public partial class PolicyWithComplianceContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPolicyWithComplianceContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyWithComplianceContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyWithComplianceContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_referencePolicyId = If( json?.PropertyT("referencePolicyId"), out var __jsonReferencePolicyId) ? (string)__jsonReferencePolicyId : (string)ReferencePolicyId;} + {_complianceState = If( json?.PropertyT("complianceState"), out var __jsonComplianceState) ? (string)__jsonComplianceState : (string)ComplianceState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._referencePolicyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._referencePolicyId.ToString()) : null, "referencePolicyId" ,container.Add ); + AddIf( null != (((object)this._complianceState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._complianceState.ToString()) : null, "complianceState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCollection.cs new file mode 100644 index 000000000000..65d8cdf65e1b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCollection.cs @@ -0,0 +1,71 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The collection of the developer portal configurations. + public partial class PortalConfigCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract[] _value; + + /// The developer portal configurations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PortalConfigCollection() + { + + } + } + /// The collection of the developer portal configurations. + public partial interface IPortalConfigCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The developer portal configurations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The developer portal configurations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract[] Value { get; set; } + + } + /// The collection of the developer portal configurations. + internal partial interface IPortalConfigCollectionInternal + + { + /// Next page link if any. + string NextLink { get; set; } + /// The developer portal configurations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCollection.json.cs new file mode 100644 index 000000000000..262e37d784ec --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCollection.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The collection of the developer portal configurations. + public partial class PortalConfigCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalConfigCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalConfigCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigContract.cs new file mode 100644 index 000000000000..9b8ca35d25ef --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigContract.cs @@ -0,0 +1,319 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The developer portal configuration contract. + public partial class PortalConfigContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Allowed origins, e.g. `https://trusted.com`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CorAllowedOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).CorAllowedOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).CorAllowedOrigin = value ?? null /* arrayOf */; } + + /// Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CspAllowedSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).CspAllowedSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).CspAllowedSource = value ?? null /* arrayOf */; } + + /// The mode of the developer portal Content Security Policy (CSP). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode? CspMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).CspMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).CspMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode)""); } + + /// The URLs used by the browser to report CSP violations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CspReportUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).CspReportUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).CspReportUri = value ?? null /* arrayOf */; } + + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? DelegationDelegateRegistration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).DelegationDelegateRegistration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).DelegationDelegateRegistration = value ?? default(bool); } + + /// Enable or disable delegation for product subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? DelegationDelegateSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).DelegationDelegateSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).DelegationDelegateSubscription = value ?? default(bool); } + + /// A delegation endpoint URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DelegationUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).DelegationUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).DelegationUrl = value ?? null; } + + /// + /// A base64-encoded validation key to ensure requests originate from Azure API Management service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DelegationValidationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).DelegationValidationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).DelegationValidationKey = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Enable or disable Basic authentication method. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? EnableBasicAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).EnableBasicAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).EnableBasicAuth = value ?? default(bool); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Cor + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContractInternal.Cor { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).Cor; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).Cor = value; } + + /// Internal Acessors for Csp + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContractInternal.Csp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).Csp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).Csp = value; } + + /// Internal Acessors for Delegation + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContractInternal.Delegation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).Delegation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).Delegation = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigProperties()); set { {_property = value;} } } + + /// Internal Acessors for Signin + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignin Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContractInternal.Signin { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).Signin; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).Signin = value; } + + /// Internal Acessors for Signup + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignup Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContractInternal.Signup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).Signup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).Signup = value; } + + /// Internal Acessors for SignupTermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContractInternal.SignupTermsOfService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).SignupTermsOfService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).SignupTermsOfService = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigProperties _property; + + /// The developer portal configuration contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigProperties()); set => this._property = value; } + + /// Redirect anonymous users to the sign-in page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SigninRequire { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).SigninRequire; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).SigninRequire = value ?? default(bool); } + + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceRequireConsent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).TermOfServiceRequireConsent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).TermOfServiceRequireConsent = value ?? default(bool); } + + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TermOfServiceText { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).TermOfServiceText; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal)Property).TermOfServiceText = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public PortalConfigContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The developer portal configuration contract. + public partial interface IPortalConfigContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Allowed origins, e.g. `https://trusted.com`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allowed origins, e.g. `https://trusted.com`.", + SerializedName = @"allowedOrigins", + PossibleTypes = new [] { typeof(string) })] + string[] CorAllowedOrigin { get; set; } + /// Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`.", + SerializedName = @"allowedSources", + PossibleTypes = new [] { typeof(string) })] + string[] CspAllowedSource { get; set; } + /// The mode of the developer portal Content Security Policy (CSP). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mode of the developer portal Content Security Policy (CSP).", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode? CspMode { get; set; } + /// The URLs used by the browser to report CSP violations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URLs used by the browser to report CSP violations.", + SerializedName = @"reportUri", + PossibleTypes = new [] { typeof(string) })] + string[] CspReportUri { get; set; } + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for user registration.", + SerializedName = @"delegateRegistration", + PossibleTypes = new [] { typeof(bool) })] + bool? DelegationDelegateRegistration { get; set; } + /// Enable or disable delegation for product subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for product subscriptions.", + SerializedName = @"delegateSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? DelegationDelegateSubscription { get; set; } + /// A delegation endpoint URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A delegation endpoint URL.", + SerializedName = @"delegationUrl", + PossibleTypes = new [] { typeof(string) })] + string DelegationUrl { get; set; } + /// + /// A base64-encoded validation key to ensure requests originate from Azure API Management service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64-encoded validation key to ensure requests originate from Azure API Management service.", + SerializedName = @"validationKey", + PossibleTypes = new [] { typeof(string) })] + string DelegationValidationKey { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Enable or disable Basic authentication method. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable Basic authentication method.", + SerializedName = @"enableBasicAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableBasicAuth { get; set; } + /// Redirect anonymous users to the sign-in page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect anonymous users to the sign-in page.", + SerializedName = @"require", + PossibleTypes = new [] { typeof(bool) })] + bool? SigninRequire { get; set; } + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ask user for consent to the terms of service.", + SerializedName = @"requireConsent", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceRequireConsent { get; set; } + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A terms of service text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string TermOfServiceText { get; set; } + + } + /// The developer portal configuration contract. + internal partial interface IPortalConfigContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// The developer portal Cross-Origin Resource Sharing (CORS) settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsProperties Cor { get; set; } + /// Allowed origins, e.g. `https://trusted.com`. + string[] CorAllowedOrigin { get; set; } + /// The developer portal Content Security Policy (CSP) settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspProperties Csp { get; set; } + /// Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`. + string[] CspAllowedSource { get; set; } + /// The mode of the developer portal Content Security Policy (CSP). + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode? CspMode { get; set; } + /// The URLs used by the browser to report CSP violations. + string[] CspReportUri { get; set; } + /// The developer portal delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationProperties Delegation { get; set; } + /// Enable or disable delegation for user registration. + bool? DelegationDelegateRegistration { get; set; } + /// Enable or disable delegation for product subscriptions. + bool? DelegationDelegateSubscription { get; set; } + /// A delegation endpoint URL. + string DelegationUrl { get; set; } + /// + /// A base64-encoded validation key to ensure requests originate from Azure API Management service. + /// + string DelegationValidationKey { get; set; } + + string ETag { get; set; } + /// Enable or disable Basic authentication method. + bool? EnableBasicAuth { get; set; } + /// The developer portal configuration contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigProperties Property { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignin Signin { get; set; } + /// Redirect anonymous users to the sign-in page. + bool? SigninRequire { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignup Signup { get; set; } + /// Terms of service settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties SignupTermsOfService { get; set; } + /// Ask user for consent to the terms of service. + bool? TermOfServiceRequireConsent { get; set; } + /// A terms of service text. + string TermOfServiceText { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigContract.json.cs new file mode 100644 index 000000000000..b859255f44b4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The developer portal configuration contract. + public partial class PortalConfigContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalConfigContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalConfigContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCorsProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCorsProperties.cs new file mode 100644 index 000000000000..a692164f2828 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCorsProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The developer portal Cross-Origin Resource Sharing (CORS) settings. + public partial class PortalConfigCorsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsPropertiesInternal + { + + /// Backing field for property. + private string[] _allowedOrigin; + + /// Allowed origins, e.g. `https://trusted.com`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] AllowedOrigin { get => this._allowedOrigin; set => this._allowedOrigin = value; } + + /// Creates an new instance. + public PortalConfigCorsProperties() + { + + } + } + /// The developer portal Cross-Origin Resource Sharing (CORS) settings. + public partial interface IPortalConfigCorsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Allowed origins, e.g. `https://trusted.com`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allowed origins, e.g. `https://trusted.com`.", + SerializedName = @"allowedOrigins", + PossibleTypes = new [] { typeof(string) })] + string[] AllowedOrigin { get; set; } + + } + /// The developer portal Cross-Origin Resource Sharing (CORS) settings. + internal partial interface IPortalConfigCorsPropertiesInternal + + { + /// Allowed origins, e.g. `https://trusted.com`. + string[] AllowedOrigin { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCorsProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCorsProperties.json.cs new file mode 100644 index 000000000000..7303c58701a2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCorsProperties.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The developer portal Cross-Origin Resource Sharing (CORS) settings. + public partial class PortalConfigCorsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalConfigCorsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalConfigCorsProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_allowedOrigin = If( json?.PropertyT("allowedOrigins"), out var __jsonAllowedOrigins) ? If( __jsonAllowedOrigins as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AllowedOrigin;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._allowedOrigin) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._allowedOrigin ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("allowedOrigins",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCspProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCspProperties.cs new file mode 100644 index 000000000000..65149576aca3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCspProperties.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The developer portal Content Security Policy (CSP) settings. + public partial class PortalConfigCspProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspPropertiesInternal + { + + /// Backing field for property. + private string[] _allowedSource; + + /// Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] AllowedSource { get => this._allowedSource; set => this._allowedSource = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode? _mode; + + /// The mode of the developer portal Content Security Policy (CSP). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode? Mode { get => this._mode; set => this._mode = value; } + + /// Backing field for property. + private string[] _reportUri; + + /// The URLs used by the browser to report CSP violations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] ReportUri { get => this._reportUri; set => this._reportUri = value; } + + /// Creates an new instance. + public PortalConfigCspProperties() + { + + } + } + /// The developer portal Content Security Policy (CSP) settings. + public partial interface IPortalConfigCspProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`.", + SerializedName = @"allowedSources", + PossibleTypes = new [] { typeof(string) })] + string[] AllowedSource { get; set; } + /// The mode of the developer portal Content Security Policy (CSP). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mode of the developer portal Content Security Policy (CSP).", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode? Mode { get; set; } + /// The URLs used by the browser to report CSP violations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URLs used by the browser to report CSP violations.", + SerializedName = @"reportUri", + PossibleTypes = new [] { typeof(string) })] + string[] ReportUri { get; set; } + + } + /// The developer portal Content Security Policy (CSP) settings. + internal partial interface IPortalConfigCspPropertiesInternal + + { + /// Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`. + string[] AllowedSource { get; set; } + /// The mode of the developer portal Content Security Policy (CSP). + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode? Mode { get; set; } + /// The URLs used by the browser to report CSP violations. + string[] ReportUri { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCspProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCspProperties.json.cs new file mode 100644 index 000000000000..3383f2260fa6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigCspProperties.json.cs @@ -0,0 +1,128 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The developer portal Content Security Policy (CSP) settings. + public partial class PortalConfigCspProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalConfigCspProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalConfigCspProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} + {_reportUri = If( json?.PropertyT("reportUri"), out var __jsonReportUri) ? If( __jsonReportUri as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ReportUri;} + {_allowedSource = If( json?.PropertyT("allowedSources"), out var __jsonAllowedSources) ? If( __jsonAllowedSources as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : AllowedSource;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + if (null != this._reportUri) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._reportUri ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("reportUri",__w); + } + if (null != this._allowedSource) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._allowedSource ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("allowedSources",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigDelegationProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigDelegationProperties.cs new file mode 100644 index 000000000000..cea29119e707 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigDelegationProperties.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigDelegationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationPropertiesInternal + { + + /// Backing field for property. + private bool? _delegateRegistration; + + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? DelegateRegistration { get => this._delegateRegistration; set => this._delegateRegistration = value; } + + /// Backing field for property. + private bool? _delegateSubscription; + + /// Enable or disable delegation for product subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? DelegateSubscription { get => this._delegateSubscription; set => this._delegateSubscription = value; } + + /// Backing field for property. + private string _delegationUrl; + + /// A delegation endpoint URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DelegationUrl { get => this._delegationUrl; set => this._delegationUrl = value; } + + /// Backing field for property. + private string _validationKey; + + /// + /// A base64-encoded validation key to ensure requests originate from Azure API Management service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ValidationKey { get => this._validationKey; set => this._validationKey = value; } + + /// Creates an new instance. + public PortalConfigDelegationProperties() + { + + } + } + public partial interface IPortalConfigDelegationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for user registration.", + SerializedName = @"delegateRegistration", + PossibleTypes = new [] { typeof(bool) })] + bool? DelegateRegistration { get; set; } + /// Enable or disable delegation for product subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for product subscriptions.", + SerializedName = @"delegateSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? DelegateSubscription { get; set; } + /// A delegation endpoint URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A delegation endpoint URL.", + SerializedName = @"delegationUrl", + PossibleTypes = new [] { typeof(string) })] + string DelegationUrl { get; set; } + /// + /// A base64-encoded validation key to ensure requests originate from Azure API Management service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64-encoded validation key to ensure requests originate from Azure API Management service.", + SerializedName = @"validationKey", + PossibleTypes = new [] { typeof(string) })] + string ValidationKey { get; set; } + + } + internal partial interface IPortalConfigDelegationPropertiesInternal + + { + /// Enable or disable delegation for user registration. + bool? DelegateRegistration { get; set; } + /// Enable or disable delegation for product subscriptions. + bool? DelegateSubscription { get; set; } + /// A delegation endpoint URL. + string DelegationUrl { get; set; } + /// + /// A base64-encoded validation key to ensure requests originate from Azure API Management service. + /// + string ValidationKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigDelegationProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigDelegationProperties.json.cs new file mode 100644 index 000000000000..ebd4b28d53ff --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigDelegationProperties.json.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigDelegationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalConfigDelegationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalConfigDelegationProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_delegateRegistration = If( json?.PropertyT("delegateRegistration"), out var __jsonDelegateRegistration) ? (bool?)__jsonDelegateRegistration : DelegateRegistration;} + {_delegateSubscription = If( json?.PropertyT("delegateSubscription"), out var __jsonDelegateSubscription) ? (bool?)__jsonDelegateSubscription : DelegateSubscription;} + {_delegationUrl = If( json?.PropertyT("delegationUrl"), out var __jsonDelegationUrl) ? (string)__jsonDelegationUrl : (string)DelegationUrl;} + {_validationKey = If( json?.PropertyT("validationKey"), out var __jsonValidationKey) ? (string)__jsonValidationKey : (string)ValidationKey;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._delegateRegistration ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._delegateRegistration) : null, "delegateRegistration" ,container.Add ); + AddIf( null != this._delegateSubscription ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._delegateSubscription) : null, "delegateSubscription" ,container.Add ); + AddIf( null != (((object)this._delegationUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._delegationUrl.ToString()) : null, "delegationUrl" ,container.Add ); + AddIf( null != (((object)this._validationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._validationKey.ToString()) : null, "validationKey" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigProperties.cs new file mode 100644 index 000000000000..3c09ad045eca --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigProperties.cs @@ -0,0 +1,274 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The developer portal configuration contract properties. + public partial class PortalConfigProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsProperties _cor; + + /// The developer portal Cross-Origin Resource Sharing (CORS) settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsProperties Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigCorsProperties()); set => this._cor = value; } + + /// Allowed origins, e.g. `https://trusted.com`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CorAllowedOrigin { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsPropertiesInternal)Cor).AllowedOrigin; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsPropertiesInternal)Cor).AllowedOrigin = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspProperties _csp; + + /// The developer portal Content Security Policy (CSP) settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspProperties Csp { get => (this._csp = this._csp ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigCspProperties()); set => this._csp = value; } + + /// Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CspAllowedSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspPropertiesInternal)Csp).AllowedSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspPropertiesInternal)Csp).AllowedSource = value ?? null /* arrayOf */; } + + /// The mode of the developer portal Content Security Policy (CSP). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode? CspMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspPropertiesInternal)Csp).Mode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspPropertiesInternal)Csp).Mode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode)""); } + + /// The URLs used by the browser to report CSP violations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] CspReportUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspPropertiesInternal)Csp).ReportUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspPropertiesInternal)Csp).ReportUri = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationProperties _delegation; + + /// The developer portal delegation settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationProperties Delegation { get => (this._delegation = this._delegation ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigDelegationProperties()); set => this._delegation = value; } + + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? DelegationDelegateRegistration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationPropertiesInternal)Delegation).DelegateRegistration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationPropertiesInternal)Delegation).DelegateRegistration = value ?? default(bool); } + + /// Enable or disable delegation for product subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? DelegationDelegateSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationPropertiesInternal)Delegation).DelegateSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationPropertiesInternal)Delegation).DelegateSubscription = value ?? default(bool); } + + /// A delegation endpoint URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DelegationUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationPropertiesInternal)Delegation).DelegationUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationPropertiesInternal)Delegation).DelegationUrl = value ?? null; } + + /// + /// A base64-encoded validation key to ensure requests originate from Azure API Management service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DelegationValidationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationPropertiesInternal)Delegation).ValidationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationPropertiesInternal)Delegation).ValidationKey = value ?? null; } + + /// Backing field for property. + private bool? _enableBasicAuth; + + /// Enable or disable Basic authentication method. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? EnableBasicAuth { get => this._enableBasicAuth; set => this._enableBasicAuth = value; } + + /// Internal Acessors for Cor + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal.Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigCorsProperties()); set { {_cor = value;} } } + + /// Internal Acessors for Csp + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal.Csp { get => (this._csp = this._csp ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigCspProperties()); set { {_csp = value;} } } + + /// Internal Acessors for Delegation + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal.Delegation { get => (this._delegation = this._delegation ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigDelegationProperties()); set { {_delegation = value;} } } + + /// Internal Acessors for Signin + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignin Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal.Signin { get => (this._signin = this._signin ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigPropertiesSignin()); set { {_signin = value;} } } + + /// Internal Acessors for Signup + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignup Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal.Signup { get => (this._signup = this._signup ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigPropertiesSignup()); set { {_signup = value;} } } + + /// Internal Acessors for SignupTermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesInternal.SignupTermsOfService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignupInternal)Signup).TermsOfService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignupInternal)Signup).TermsOfService = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignin _signin; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignin Signin { get => (this._signin = this._signin ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigPropertiesSignin()); set => this._signin = value; } + + /// Redirect anonymous users to the sign-in page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SigninRequire { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSigninInternal)Signin).Require; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSigninInternal)Signin).Require = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignup _signup; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignup Signup { get => (this._signup = this._signup ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigPropertiesSignup()); set => this._signup = value; } + + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceRequireConsent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignupInternal)Signup).TermOfServiceRequireConsent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignupInternal)Signup).TermOfServiceRequireConsent = value ?? default(bool); } + + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TermOfServiceText { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignupInternal)Signup).TermOfServiceText; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignupInternal)Signup).TermOfServiceText = value ?? null; } + + /// Creates an new instance. + public PortalConfigProperties() + { + + } + } + /// The developer portal configuration contract properties. + public partial interface IPortalConfigProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Allowed origins, e.g. `https://trusted.com`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allowed origins, e.g. `https://trusted.com`.", + SerializedName = @"allowedOrigins", + PossibleTypes = new [] { typeof(string) })] + string[] CorAllowedOrigin { get; set; } + /// Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`.", + SerializedName = @"allowedSources", + PossibleTypes = new [] { typeof(string) })] + string[] CspAllowedSource { get; set; } + /// The mode of the developer portal Content Security Policy (CSP). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mode of the developer portal Content Security Policy (CSP).", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode? CspMode { get; set; } + /// The URLs used by the browser to report CSP violations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URLs used by the browser to report CSP violations.", + SerializedName = @"reportUri", + PossibleTypes = new [] { typeof(string) })] + string[] CspReportUri { get; set; } + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for user registration.", + SerializedName = @"delegateRegistration", + PossibleTypes = new [] { typeof(bool) })] + bool? DelegationDelegateRegistration { get; set; } + /// Enable or disable delegation for product subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for product subscriptions.", + SerializedName = @"delegateSubscription", + PossibleTypes = new [] { typeof(bool) })] + bool? DelegationDelegateSubscription { get; set; } + /// A delegation endpoint URL. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A delegation endpoint URL.", + SerializedName = @"delegationUrl", + PossibleTypes = new [] { typeof(string) })] + string DelegationUrl { get; set; } + /// + /// A base64-encoded validation key to ensure requests originate from Azure API Management service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64-encoded validation key to ensure requests originate from Azure API Management service.", + SerializedName = @"validationKey", + PossibleTypes = new [] { typeof(string) })] + string DelegationValidationKey { get; set; } + /// Enable or disable Basic authentication method. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable Basic authentication method.", + SerializedName = @"enableBasicAuth", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableBasicAuth { get; set; } + /// Redirect anonymous users to the sign-in page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect anonymous users to the sign-in page.", + SerializedName = @"require", + PossibleTypes = new [] { typeof(bool) })] + bool? SigninRequire { get; set; } + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ask user for consent to the terms of service.", + SerializedName = @"requireConsent", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceRequireConsent { get; set; } + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A terms of service text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string TermOfServiceText { get; set; } + + } + /// The developer portal configuration contract properties. + internal partial interface IPortalConfigPropertiesInternal + + { + /// The developer portal Cross-Origin Resource Sharing (CORS) settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCorsProperties Cor { get; set; } + /// Allowed origins, e.g. `https://trusted.com`. + string[] CorAllowedOrigin { get; set; } + /// The developer portal Content Security Policy (CSP) settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigCspProperties Csp { get; set; } + /// Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`. + string[] CspAllowedSource { get; set; } + /// The mode of the developer portal Content Security Policy (CSP). + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode? CspMode { get; set; } + /// The URLs used by the browser to report CSP violations. + string[] CspReportUri { get; set; } + /// The developer portal delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigDelegationProperties Delegation { get; set; } + /// Enable or disable delegation for user registration. + bool? DelegationDelegateRegistration { get; set; } + /// Enable or disable delegation for product subscriptions. + bool? DelegationDelegateSubscription { get; set; } + /// A delegation endpoint URL. + string DelegationUrl { get; set; } + /// + /// A base64-encoded validation key to ensure requests originate from Azure API Management service. + /// + string DelegationValidationKey { get; set; } + /// Enable or disable Basic authentication method. + bool? EnableBasicAuth { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignin Signin { get; set; } + /// Redirect anonymous users to the sign-in page. + bool? SigninRequire { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignup Signup { get; set; } + /// Terms of service settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties SignupTermsOfService { get; set; } + /// Ask user for consent to the terms of service. + bool? TermOfServiceRequireConsent { get; set; } + /// A terms of service text. + string TermOfServiceText { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigProperties.json.cs new file mode 100644 index 000000000000..7f5d2edc9186 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigProperties.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The developer portal configuration contract properties. + public partial class PortalConfigProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalConfigProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalConfigProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_signin = If( json?.PropertyT("signin"), out var __jsonSignin) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigPropertiesSignin.FromJson(__jsonSignin) : Signin;} + {_signup = If( json?.PropertyT("signup"), out var __jsonSignup) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigPropertiesSignup.FromJson(__jsonSignup) : Signup;} + {_delegation = If( json?.PropertyT("delegation"), out var __jsonDelegation) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigDelegationProperties.FromJson(__jsonDelegation) : Delegation;} + {_cor = If( json?.PropertyT("cors"), out var __jsonCors) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigCorsProperties.FromJson(__jsonCors) : Cor;} + {_csp = If( json?.PropertyT("csp"), out var __jsonCsp) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigCspProperties.FromJson(__jsonCsp) : Csp;} + {_enableBasicAuth = If( json?.PropertyT("enableBasicAuth"), out var __jsonEnableBasicAuth) ? (bool?)__jsonEnableBasicAuth : EnableBasicAuth;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._signin ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._signin.ToJson(null,serializationMode) : null, "signin" ,container.Add ); + AddIf( null != this._signup ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._signup.ToJson(null,serializationMode) : null, "signup" ,container.Add ); + AddIf( null != this._delegation ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._delegation.ToJson(null,serializationMode) : null, "delegation" ,container.Add ); + AddIf( null != this._cor ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._cor.ToJson(null,serializationMode) : null, "cors" ,container.Add ); + AddIf( null != this._csp ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._csp.ToJson(null,serializationMode) : null, "csp" ,container.Add ); + AddIf( null != this._enableBasicAuth ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enableBasicAuth) : null, "enableBasicAuth" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignin.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignin.cs new file mode 100644 index 000000000000..4970a8d1d1d0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignin.cs @@ -0,0 +1,48 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigPropertiesSignin : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignin, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSigninInternal + { + + /// Backing field for property. + private bool? _require; + + /// Redirect anonymous users to the sign-in page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Require { get => this._require; set => this._require = value; } + + /// Creates an new instance. + public PortalConfigPropertiesSignin() + { + + } + } + public partial interface IPortalConfigPropertiesSignin : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Redirect anonymous users to the sign-in page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect anonymous users to the sign-in page.", + SerializedName = @"require", + PossibleTypes = new [] { typeof(bool) })] + bool? Require { get; set; } + + } + internal partial interface IPortalConfigPropertiesSigninInternal + + { + /// Redirect anonymous users to the sign-in page. + bool? Require { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignin.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignin.json.cs new file mode 100644 index 000000000000..ed5e35e15aa9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignin.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigPropertiesSignin + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignin. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignin. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignin FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalConfigPropertiesSignin(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalConfigPropertiesSignin(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_require = If( json?.PropertyT("require"), out var __jsonRequire) ? (bool?)__jsonRequire : Require;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._require ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._require) : null, "require" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignup.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignup.cs new file mode 100644 index 000000000000..c88082c2dd24 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignup.cs @@ -0,0 +1,71 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigPropertiesSignup : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignup, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignupInternal + { + + /// Internal Acessors for TermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignupInternal.TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigTermsOfServiceProperties()); set { {_termsOfService = value;} } } + + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceRequireConsent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServicePropertiesInternal)TermsOfService).RequireConsent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServicePropertiesInternal)TermsOfService).RequireConsent = value ?? default(bool); } + + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TermOfServiceText { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServicePropertiesInternal)TermsOfService).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServicePropertiesInternal)TermsOfService).Text = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties _termsOfService; + + /// Terms of service settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigTermsOfServiceProperties()); set => this._termsOfService = value; } + + /// Creates an new instance. + public PortalConfigPropertiesSignup() + { + + } + } + public partial interface IPortalConfigPropertiesSignup : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ask user for consent to the terms of service.", + SerializedName = @"requireConsent", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceRequireConsent { get; set; } + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A terms of service text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string TermOfServiceText { get; set; } + + } + internal partial interface IPortalConfigPropertiesSignupInternal + + { + /// Ask user for consent to the terms of service. + bool? TermOfServiceRequireConsent { get; set; } + /// A terms of service text. + string TermOfServiceText { get; set; } + /// Terms of service settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties TermsOfService { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignup.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignup.json.cs new file mode 100644 index 000000000000..55e3062d9881 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigPropertiesSignup.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigPropertiesSignup + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignup. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignup. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigPropertiesSignup FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalConfigPropertiesSignup(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalConfigPropertiesSignup(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_termsOfService = If( json?.PropertyT("termsOfService"), out var __jsonTermsOfService) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalConfigTermsOfServiceProperties.FromJson(__jsonTermsOfService) : TermsOfService;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._termsOfService ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._termsOfService.ToJson(null,serializationMode) : null, "termsOfService" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigTermsOfServiceProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigTermsOfServiceProperties.cs new file mode 100644 index 000000000000..c329c1e3e40e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigTermsOfServiceProperties.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Terms of service contract properties. + public partial class PortalConfigTermsOfServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServicePropertiesInternal + { + + /// Backing field for property. + private bool? _requireConsent; + + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? RequireConsent { get => this._requireConsent; set => this._requireConsent = value; } + + /// Backing field for property. + private string _text; + + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Text { get => this._text; set => this._text = value; } + + /// Creates an new instance. + public PortalConfigTermsOfServiceProperties() + { + + } + } + /// Terms of service contract properties. + public partial interface IPortalConfigTermsOfServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ask user for consent to the terms of service.", + SerializedName = @"requireConsent", + PossibleTypes = new [] { typeof(bool) })] + bool? RequireConsent { get; set; } + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A terms of service text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string Text { get; set; } + + } + /// Terms of service contract properties. + internal partial interface IPortalConfigTermsOfServicePropertiesInternal + + { + /// Ask user for consent to the terms of service. + bool? RequireConsent { get; set; } + /// A terms of service text. + string Text { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigTermsOfServiceProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigTermsOfServiceProperties.json.cs new file mode 100644 index 000000000000..a1423092c232 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalConfigTermsOfServiceProperties.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Terms of service contract properties. + public partial class PortalConfigTermsOfServiceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalConfigTermsOfServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalConfigTermsOfServiceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalConfigTermsOfServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_text = If( json?.PropertyT("text"), out var __jsonText) ? (string)__jsonText : (string)Text;} + {_requireConsent = If( json?.PropertyT("requireConsent"), out var __jsonRequireConsent) ? (bool?)__jsonRequireConsent : RequireConsent;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._text)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._text.ToString()) : null, "text" ,container.Add ); + AddIf( null != this._requireConsent ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._requireConsent) : null, "requireConsent" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettings.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettings.cs new file mode 100644 index 000000000000..2222587f9596 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettings.cs @@ -0,0 +1,185 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Delegation settings for a developer portal. + public partial class PortalDelegationSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalDelegationSettingsProperties()); set { {_property = value;} } } + + /// Internal Acessors for Subscription + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsInternal.Subscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).Subscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).Subscription = value; } + + /// Internal Acessors for UserRegistration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsInternal.UserRegistration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).UserRegistration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).UserRegistration = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsProperties _property; + + /// Delegation settings contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalDelegationSettingsProperties()); set => this._property = value; } + + /// Enable or disable delegation for subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SubscriptionEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).SubscriptionEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).SubscriptionEnabled = value ?? default(bool); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// A delegation Url. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Url { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).Url = value ?? null; } + + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UserRegistrationEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).UserRegistrationEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).UserRegistrationEnabled = value ?? default(bool); } + + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ValidationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).ValidationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal)Property).ValidationKey = value ?? null; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public PortalDelegationSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Delegation settings for a developer portal. + public partial interface IPortalDelegationSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Enable or disable delegation for subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for subscriptions.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionEnabled { get; set; } + /// A delegation Url. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A delegation Url.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for user registration.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? UserRegistrationEnabled { get; set; } + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64-encoded validation key to validate, that a request is coming from Azure API Management.", + SerializedName = @"validationKey", + PossibleTypes = new [] { typeof(string) })] + string ValidationKey { get; set; } + + } + /// Delegation settings for a developer portal. + internal partial interface IPortalDelegationSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Delegation settings contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsProperties Property { get; set; } + /// Subscriptions delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties Subscription { get; set; } + /// Enable or disable delegation for subscriptions. + bool? SubscriptionEnabled { get; set; } + /// A delegation Url. + string Url { get; set; } + /// User registration delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties UserRegistration { get; set; } + /// Enable or disable delegation for user registration. + bool? UserRegistrationEnabled { get; set; } + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + string ValidationKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettings.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettings.json.cs new file mode 100644 index 000000000000..12455e3b5bd5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettings.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Delegation settings for a developer portal. + public partial class PortalDelegationSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalDelegationSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalDelegationSettings(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalDelegationSettingsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettingsProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettingsProperties.cs new file mode 100644 index 000000000000..56865cf0d42f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettingsProperties.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Delegation settings contract properties. + public partial class PortalDelegationSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal + { + + /// Internal Acessors for Subscription + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal.Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionsDelegationSettingsProperties()); set { {_subscription = value;} } } + + /// Internal Acessors for UserRegistration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsPropertiesInternal.UserRegistration { get => (this._userRegistration = this._userRegistration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RegistrationDelegationSettingsProperties()); set { {_userRegistration = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties _subscription; + + /// Subscriptions delegation settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionsDelegationSettingsProperties()); set => this._subscription = value; } + + /// Enable or disable delegation for subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SubscriptionEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsPropertiesInternal)Subscription).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsPropertiesInternal)Subscription).Enabled = value ?? default(bool); } + + /// Backing field for property. + private string _url; + + /// A delegation Url. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Url { get => this._url; set => this._url = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties _userRegistration; + + /// User registration delegation settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties UserRegistration { get => (this._userRegistration = this._userRegistration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RegistrationDelegationSettingsProperties()); set => this._userRegistration = value; } + + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UserRegistrationEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsPropertiesInternal)UserRegistration).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsPropertiesInternal)UserRegistration).Enabled = value ?? default(bool); } + + /// Backing field for property. + private string _validationKey; + + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ValidationKey { get => this._validationKey; set => this._validationKey = value; } + + /// Creates an new instance. + public PortalDelegationSettingsProperties() + { + + } + } + /// Delegation settings contract properties. + public partial interface IPortalDelegationSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Enable or disable delegation for subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for subscriptions.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionEnabled { get; set; } + /// A delegation Url. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A delegation Url.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for user registration.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? UserRegistrationEnabled { get; set; } + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64-encoded validation key to validate, that a request is coming from Azure API Management.", + SerializedName = @"validationKey", + PossibleTypes = new [] { typeof(string) })] + string ValidationKey { get; set; } + + } + /// Delegation settings contract properties. + internal partial interface IPortalDelegationSettingsPropertiesInternal + + { + /// Subscriptions delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties Subscription { get; set; } + /// Enable or disable delegation for subscriptions. + bool? SubscriptionEnabled { get; set; } + /// A delegation Url. + string Url { get; set; } + /// User registration delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties UserRegistration { get; set; } + /// Enable or disable delegation for user registration. + bool? UserRegistrationEnabled { get; set; } + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + string ValidationKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettingsProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettingsProperties.json.cs new file mode 100644 index 000000000000..a3a62fe0d1be --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalDelegationSettingsProperties.json.cs @@ -0,0 +1,115 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Delegation settings contract properties. + public partial class PortalDelegationSettingsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalDelegationSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalDelegationSettingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalDelegationSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subscription = If( json?.PropertyT("subscriptions"), out var __jsonSubscriptions) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionsDelegationSettingsProperties.FromJson(__jsonSubscriptions) : Subscription;} + {_userRegistration = If( json?.PropertyT("userRegistration"), out var __jsonUserRegistration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RegistrationDelegationSettingsProperties.FromJson(__jsonUserRegistration) : UserRegistration;} + {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)Url;} + {_validationKey = If( json?.PropertyT("validationKey"), out var __jsonValidationKey) ? (string)__jsonValidationKey : (string)ValidationKey;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._subscription ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._subscription.ToJson(null,serializationMode) : null, "subscriptions" ,container.Add ); + AddIf( null != this._userRegistration ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._userRegistration.ToJson(null,serializationMode) : null, "userRegistration" ,container.Add ); + AddIf( null != (((object)this._url)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._url.ToString()) : null, "url" ,container.Add ); + AddIf( null != (((object)this._validationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._validationKey.ToString()) : null, "validationKey" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionCollection.cs new file mode 100644 index 000000000000..60158a82b755 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionCollection.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged list of portal revisions. + public partial class PortalRevisionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link, if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract[] _value; + + /// Collection of portal revisions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract[] Value { get => this._value; } + + /// Creates an new instance. + public PortalRevisionCollection() + { + + } + } + /// Paged list of portal revisions. + public partial interface IPortalRevisionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link, if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link, if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Collection of portal revisions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Collection of portal revisions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract[] Value { get; } + + } + /// Paged list of portal revisions. + internal partial interface IPortalRevisionCollectionInternal + + { + /// Next page link, if any. + string NextLink { get; set; } + /// Collection of portal revisions. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionCollection.json.cs new file mode 100644 index 000000000000..0a260ae6786a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionCollection.json.cs @@ -0,0 +1,124 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged list of portal revisions. + public partial class PortalRevisionCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalRevisionCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalRevisionCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalRevisionContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContract.cs new file mode 100644 index 000000000000..f3870e68bd64 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContract.cs @@ -0,0 +1,266 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Portal Revision's contract details. + public partial class PortalRevisionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Portal's revision creation date and time. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).CreatedDateTime; } + + /// Portal revision description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).Description = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Indicates if the portal's revision is public. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsCurrent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).IsCurrent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).IsCurrent = value ?? default(bool); } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for CreatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractInternal.CreatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).CreatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).CreatedDateTime = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalRevisionContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).Status = value; } + + /// Internal Acessors for StatusDetail + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractInternal.StatusDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).StatusDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).StatusDetail = value; } + + /// Internal Acessors for UpdatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractInternal.UpdatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).UpdatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).UpdatedDateTime = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractProperties _property; + + /// Properties of the portal revisions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalRevisionContractProperties()); set => this._property = value; } + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).ProvisioningState; } + + /// Status of the portal's revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).Status; } + + /// Portal revision publishing status details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string StatusDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).StatusDetail; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Last updated date and time. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? UpdatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal)Property).UpdatedDateTime; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + if (headers.TryGetValues("location", out var __locationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader1) is string __headerLocationHeader1 ? __headerLocationHeader1 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader2)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader2) is string __headerAzureAsyncOperationHeader2 ? __headerAzureAsyncOperationHeader2 : (string)null; + } + } + + /// Creates an new instance. + public PortalRevisionContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Portal Revision's contract details. + public partial interface IPortalRevisionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + /// Portal's revision creation date and time. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Portal's revision creation date and time.", + SerializedName = @"createdDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDateTime { get; } + /// Portal revision description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Portal revision description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Indicates if the portal's revision is public. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if the portal's revision is public.", + SerializedName = @"isCurrent", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCurrent { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Status of the portal's revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Status of the portal's revision.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? Status { get; } + /// Portal revision publishing status details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Portal revision publishing status details.", + SerializedName = @"statusDetails", + PossibleTypes = new [] { typeof(string) })] + string StatusDetail { get; } + /// Last updated date and time. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last updated date and time.", + SerializedName = @"updatedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UpdatedDateTime { get; } + + } + /// Portal Revision's contract details. + internal partial interface IPortalRevisionContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string AzureAsyncOperation { get; set; } + /// Portal's revision creation date and time. + global::System.DateTime? CreatedDateTime { get; set; } + /// Portal revision description. + string Description { get; set; } + + string ETag { get; set; } + /// Indicates if the portal's revision is public. + bool? IsCurrent { get; set; } + + string Location { get; set; } + /// Properties of the portal revisions. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractProperties Property { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// Status of the portal's revision. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? Status { get; set; } + /// Portal revision publishing status details. + string StatusDetail { get; set; } + /// Last updated date and time. + global::System.DateTime? UpdatedDateTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContract.json.cs new file mode 100644 index 000000000000..419225839c56 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Portal Revision's contract details. + public partial class PortalRevisionContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalRevisionContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalRevisionContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalRevisionContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContractProperties.cs new file mode 100644 index 000000000000..d17fe80e6e8b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContractProperties.cs @@ -0,0 +1,165 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalRevisionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdDateTime; + + /// Portal's revision creation date and time. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedDateTime { get => this._createdDateTime; } + + /// Backing field for property. + private string _description; + + /// Portal revision description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private bool? _isCurrent; + + /// Indicates if the portal's revision is public. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsCurrent { get => this._isCurrent; set => this._isCurrent = value; } + + /// Internal Acessors for CreatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal.CreatedDateTime { get => this._createdDateTime; set { {_createdDateTime = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for StatusDetail + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal.StatusDetail { get => this._statusDetail; set { {_statusDetail = value;} } } + + /// Internal Acessors for UpdatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractPropertiesInternal.UpdatedDateTime { get => this._updatedDateTime; set { {_updatedDateTime = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? _status; + + /// Status of the portal's revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? Status { get => this._status; } + + /// Backing field for property. + private string _statusDetail; + + /// Portal revision publishing status details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string StatusDetail { get => this._statusDetail; } + + /// Backing field for property. + private global::System.DateTime? _updatedDateTime; + + /// Last updated date and time. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? UpdatedDateTime { get => this._updatedDateTime; } + + /// Creates an new instance. + public PortalRevisionContractProperties() + { + + } + } + public partial interface IPortalRevisionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Portal's revision creation date and time. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Portal's revision creation date and time.", + SerializedName = @"createdDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDateTime { get; } + /// Portal revision description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Portal revision description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Indicates if the portal's revision is public. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if the portal's revision is public.", + SerializedName = @"isCurrent", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCurrent { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Status of the portal's revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Status of the portal's revision.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? Status { get; } + /// Portal revision publishing status details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Portal revision publishing status details.", + SerializedName = @"statusDetails", + PossibleTypes = new [] { typeof(string) })] + string StatusDetail { get; } + /// Last updated date and time. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Last updated date and time.", + SerializedName = @"updatedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UpdatedDateTime { get; } + + } + internal partial interface IPortalRevisionContractPropertiesInternal + + { + /// Portal's revision creation date and time. + global::System.DateTime? CreatedDateTime { get; set; } + /// Portal revision description. + string Description { get; set; } + /// Indicates if the portal's revision is public. + bool? IsCurrent { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + /// Status of the portal's revision. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus? Status { get; set; } + /// Portal revision publishing status details. + string StatusDetail { get; set; } + /// Last updated date and time. + global::System.DateTime? UpdatedDateTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContractProperties.json.cs new file mode 100644 index 000000000000..c3f5480062fa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalRevisionContractProperties.json.cs @@ -0,0 +1,134 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalRevisionContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalRevisionContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalRevisionContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalRevisionContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_statusDetail = If( json?.PropertyT("statusDetails"), out var __jsonStatusDetails) ? (string)__jsonStatusDetails : (string)StatusDetail;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_isCurrent = If( json?.PropertyT("isCurrent"), out var __jsonIsCurrent) ? (bool?)__jsonIsCurrent : IsCurrent;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} + {_updatedDateTime = If( json?.PropertyT("updatedDateTime"), out var __jsonUpdatedDateTime) ? global::System.DateTime.TryParse((string)__jsonUpdatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedDateTimeValue) ? __jsonUpdatedDateTimeValue : UpdatedDateTime : UpdatedDateTime;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._statusDetail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._statusDetail.ToString()) : null, "statusDetails" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + AddIf( null != this._isCurrent ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isCurrent) : null, "isCurrent" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._createdDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._createdDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdDateTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._updatedDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._updatedDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "updatedDateTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingValidationKeyContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingValidationKeyContract.cs new file mode 100644 index 000000000000..a2765034dd6b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingValidationKeyContract.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + public partial class PortalSettingValidationKeyContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingValidationKeyContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingValidationKeyContractInternal + { + + /// Backing field for property. + private string _validationKey; + + /// This is secret value of the validation key in portal settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ValidationKey { get => this._validationKey; set => this._validationKey = value; } + + /// Creates an new instance. + public PortalSettingValidationKeyContract() + { + + } + } + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + public partial interface IPortalSettingValidationKeyContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// This is secret value of the validation key in portal settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is secret value of the validation key in portal settings.", + SerializedName = @"validationKey", + PossibleTypes = new [] { typeof(string) })] + string ValidationKey { get; set; } + + } + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + internal partial interface IPortalSettingValidationKeyContractInternal + + { + /// This is secret value of the validation key in portal settings. + string ValidationKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingValidationKeyContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingValidationKeyContract.json.cs new file mode 100644 index 000000000000..604baa72d62d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingValidationKeyContract.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + public partial class PortalSettingValidationKeyContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingValidationKeyContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingValidationKeyContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingValidationKeyContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalSettingValidationKeyContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalSettingValidationKeyContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_validationKey = If( json?.PropertyT("validationKey"), out var __jsonValidationKey) ? (string)__jsonValidationKey : (string)ValidationKey;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._validationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._validationKey.ToString()) : null, "validationKey" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsCollection.cs new file mode 100644 index 000000000000..3ee7f68ce515 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsCollection.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Descriptions of API Management policies. + public partial class PortalSettingsCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContract[] _value; + + /// Descriptions of API Management policies. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PortalSettingsCollection() + { + + } + } + /// Descriptions of API Management policies. + public partial interface IPortalSettingsCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Descriptions of API Management policies. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Descriptions of API Management policies.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContract[] Value { get; set; } + + } + /// Descriptions of API Management policies. + internal partial interface IPortalSettingsCollectionInternal + + { + /// Total record count number. + long? Count { get; set; } + /// Descriptions of API Management policies. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsCollection.json.cs new file mode 100644 index 000000000000..3c764f4cce3b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsCollection.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Descriptions of API Management policies. + public partial class PortalSettingsCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalSettingsCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalSettingsCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSettingsContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContract.cs new file mode 100644 index 000000000000..6f8b2bfce062 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContract.cs @@ -0,0 +1,222 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Portal Settings for the Developer Portal. + public partial class PortalSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Redirect Anonymous users to the Sign-In page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).Enabled = value ?? default(bool); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSettingsContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for Subscription + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractInternal.Subscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).Subscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).Subscription = value; } + + /// Internal Acessors for TermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractInternal.TermsOfService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).TermsOfService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).TermsOfService = value; } + + /// Internal Acessors for UserRegistration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractInternal.UserRegistration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).UserRegistration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).UserRegistration = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractProperties _property; + + /// Portal Settings contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSettingsContractProperties()); set => this._property = value; } + + /// Enable or disable delegation for subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SubscriptionEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).SubscriptionEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).SubscriptionEnabled = value ?? default(bool); } + + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceConsentRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).TermOfServiceConsentRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).TermOfServiceConsentRequired = value ?? default(bool); } + + /// Display terms of service during a sign-up process. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).TermOfServiceEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).TermOfServiceEnabled = value ?? default(bool); } + + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TermOfServiceText { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).TermOfServiceText; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).TermOfServiceText = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// A delegation Url. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Url { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).Url; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).Url = value ?? null; } + + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UserRegistrationEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).UserRegistrationEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).UserRegistrationEnabled = value ?? default(bool); } + + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ValidationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).ValidationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal)Property).ValidationKey = value ?? null; } + + /// Creates an new instance. + public PortalSettingsContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Portal Settings for the Developer Portal. + public partial interface IPortalSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Redirect Anonymous users to the Sign-In page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect Anonymous users to the Sign-In page.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// Enable or disable delegation for subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for subscriptions.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionEnabled { get; set; } + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ask user for consent to the terms of service.", + SerializedName = @"consentRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceConsentRequired { get; set; } + /// Display terms of service during a sign-up process. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display terms of service during a sign-up process.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceEnabled { get; set; } + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A terms of service text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string TermOfServiceText { get; set; } + /// A delegation Url. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A delegation Url.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for user registration.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? UserRegistrationEnabled { get; set; } + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64-encoded validation key to validate, that a request is coming from Azure API Management.", + SerializedName = @"validationKey", + PossibleTypes = new [] { typeof(string) })] + string ValidationKey { get; set; } + + } + /// Portal Settings for the Developer Portal. + internal partial interface IPortalSettingsContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Redirect Anonymous users to the Sign-In page. + bool? Enabled { get; set; } + /// Portal Settings contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractProperties Property { get; set; } + /// Subscriptions delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties Subscription { get; set; } + /// Enable or disable delegation for subscriptions. + bool? SubscriptionEnabled { get; set; } + /// Ask user for consent to the terms of service. + bool? TermOfServiceConsentRequired { get; set; } + /// Display terms of service during a sign-up process. + bool? TermOfServiceEnabled { get; set; } + /// A terms of service text. + string TermOfServiceText { get; set; } + /// Terms of service contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties TermsOfService { get; set; } + /// A delegation Url. + string Url { get; set; } + /// User registration delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties UserRegistration { get; set; } + /// Enable or disable delegation for user registration. + bool? UserRegistrationEnabled { get; set; } + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + string ValidationKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContract.json.cs new file mode 100644 index 000000000000..1d9cbdac1e8a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Portal Settings for the Developer Portal. + public partial class PortalSettingsContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalSettingsContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalSettingsContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSettingsContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContractProperties.cs new file mode 100644 index 000000000000..dfdf128b46f5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContractProperties.cs @@ -0,0 +1,197 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-in settings contract properties. + public partial class PortalSettingsContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Redirect Anonymous users to the Sign-In page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Internal Acessors for Subscription + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal.Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionsDelegationSettingsProperties()); set { {_subscription = value;} } } + + /// Internal Acessors for TermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal.TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TermsOfServiceProperties()); set { {_termsOfService = value;} } } + + /// Internal Acessors for UserRegistration + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractPropertiesInternal.UserRegistration { get => (this._userRegistration = this._userRegistration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RegistrationDelegationSettingsProperties()); set { {_userRegistration = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties _subscription; + + /// Subscriptions delegation settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionsDelegationSettingsProperties()); set => this._subscription = value; } + + /// Enable or disable delegation for subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SubscriptionEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsPropertiesInternal)Subscription).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsPropertiesInternal)Subscription).Enabled = value ?? default(bool); } + + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceConsentRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).ConsentRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).ConsentRequired = value ?? default(bool); } + + /// Display terms of service during a sign-up process. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).Enabled = value ?? default(bool); } + + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TermOfServiceText { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).Text = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties _termsOfService; + + /// Terms of service contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TermsOfServiceProperties()); set => this._termsOfService = value; } + + /// Backing field for property. + private string _url; + + /// A delegation Url. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Url { get => this._url; set => this._url = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties _userRegistration; + + /// User registration delegation settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties UserRegistration { get => (this._userRegistration = this._userRegistration ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RegistrationDelegationSettingsProperties()); set => this._userRegistration = value; } + + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? UserRegistrationEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsPropertiesInternal)UserRegistration).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsPropertiesInternal)UserRegistration).Enabled = value ?? default(bool); } + + /// Backing field for property. + private string _validationKey; + + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ValidationKey { get => this._validationKey; set => this._validationKey = value; } + + /// Creates an new instance. + public PortalSettingsContractProperties() + { + + } + } + /// Sign-in settings contract properties. + public partial interface IPortalSettingsContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Redirect Anonymous users to the Sign-In page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect Anonymous users to the Sign-In page.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// Enable or disable delegation for subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for subscriptions.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionEnabled { get; set; } + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ask user for consent to the terms of service.", + SerializedName = @"consentRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceConsentRequired { get; set; } + /// Display terms of service during a sign-up process. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display terms of service during a sign-up process.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceEnabled { get; set; } + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A terms of service text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string TermOfServiceText { get; set; } + /// A delegation Url. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A delegation Url.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for user registration.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? UserRegistrationEnabled { get; set; } + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64-encoded validation key to validate, that a request is coming from Azure API Management.", + SerializedName = @"validationKey", + PossibleTypes = new [] { typeof(string) })] + string ValidationKey { get; set; } + + } + /// Sign-in settings contract properties. + internal partial interface IPortalSettingsContractPropertiesInternal + + { + /// Redirect Anonymous users to the Sign-In page. + bool? Enabled { get; set; } + /// Subscriptions delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties Subscription { get; set; } + /// Enable or disable delegation for subscriptions. + bool? SubscriptionEnabled { get; set; } + /// Ask user for consent to the terms of service. + bool? TermOfServiceConsentRequired { get; set; } + /// Display terms of service during a sign-up process. + bool? TermOfServiceEnabled { get; set; } + /// A terms of service text. + string TermOfServiceText { get; set; } + /// Terms of service contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties TermsOfService { get; set; } + /// A delegation Url. + string Url { get; set; } + /// User registration delegation settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties UserRegistration { get; set; } + /// Enable or disable delegation for user registration. + bool? UserRegistrationEnabled { get; set; } + /// + /// A base64-encoded validation key to validate, that a request is coming from Azure API Management. + /// + string ValidationKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContractProperties.json.cs new file mode 100644 index 000000000000..6e2ce605a9ea --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSettingsContractProperties.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-in settings contract properties. + public partial class PortalSettingsContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSettingsContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalSettingsContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalSettingsContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subscription = If( json?.PropertyT("subscriptions"), out var __jsonSubscriptions) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionsDelegationSettingsProperties.FromJson(__jsonSubscriptions) : Subscription;} + {_userRegistration = If( json?.PropertyT("userRegistration"), out var __jsonUserRegistration) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RegistrationDelegationSettingsProperties.FromJson(__jsonUserRegistration) : UserRegistration;} + {_termsOfService = If( json?.PropertyT("termsOfService"), out var __jsonTermsOfService) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TermsOfServiceProperties.FromJson(__jsonTermsOfService) : TermsOfService;} + {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)Url;} + {_validationKey = If( json?.PropertyT("validationKey"), out var __jsonValidationKey) ? (string)__jsonValidationKey : (string)ValidationKey;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._subscription ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._subscription.ToJson(null,serializationMode) : null, "subscriptions" ,container.Add ); + AddIf( null != this._userRegistration ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._userRegistration.ToJson(null,serializationMode) : null, "userRegistration" ,container.Add ); + AddIf( null != this._termsOfService ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._termsOfService.ToJson(null,serializationMode) : null, "termsOfService" ,container.Add ); + AddIf( null != (((object)this._url)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._url.ToString()) : null, "url" ,container.Add ); + AddIf( null != (((object)this._validationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._validationKey.ToString()) : null, "validationKey" ,container.Add ); + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettingProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettingProperties.cs new file mode 100644 index 000000000000..ee1d69d41549 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettingProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-in settings contract properties. + public partial class PortalSigninSettingProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingPropertiesInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Redirect Anonymous users to the Sign-In page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Creates an new instance. + public PortalSigninSettingProperties() + { + + } + } + /// Sign-in settings contract properties. + public partial interface IPortalSigninSettingProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Redirect Anonymous users to the Sign-In page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect Anonymous users to the Sign-In page.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Sign-in settings contract properties. + internal partial interface IPortalSigninSettingPropertiesInternal + + { + /// Redirect Anonymous users to the Sign-In page. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettingProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettingProperties.json.cs new file mode 100644 index 000000000000..6c6c3743e057 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettingProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-in settings contract properties. + public partial class PortalSigninSettingProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalSigninSettingProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalSigninSettingProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettings.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettings.cs new file mode 100644 index 000000000000..6d6d66e59643 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettings.cs @@ -0,0 +1,127 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-In settings for the Developer Portal. + public partial class PortalSigninSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Redirect Anonymous users to the Sign-In page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingPropertiesInternal)Property).Enabled = value ?? default(bool); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSigninSettingProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingProperties _property; + + /// Sign-in settings contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSigninSettingProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingsInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public PortalSigninSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Sign-In settings for the Developer Portal. + public partial interface IPortalSigninSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Redirect Anonymous users to the Sign-In page. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Redirect Anonymous users to the Sign-In page.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Sign-In settings for the Developer Portal. + internal partial interface IPortalSigninSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Redirect Anonymous users to the Sign-In page. + bool? Enabled { get; set; } + /// Sign-in settings contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettingProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettings.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettings.json.cs new file mode 100644 index 000000000000..b6fdbfb6975f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSigninSettings.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-In settings for the Developer Portal. + public partial class PortalSigninSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSigninSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalSigninSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalSigninSettings(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSigninSettingProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettings.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettings.cs new file mode 100644 index 000000000000..af4d98cd3228 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettings.cs @@ -0,0 +1,174 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-Up settings for a developer portal. + public partial class PortalSignupSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Allow users to sign up on a developer portal. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal)Property).Enabled = value ?? default(bool); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSignupSettingsProperties()); set { {_property = value;} } } + + /// Internal Acessors for TermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsInternal.TermsOfService { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal)Property).TermsOfService; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal)Property).TermsOfService = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsProperties _property; + + /// Sign-up settings contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSignupSettingsProperties()); set => this._property = value; } + + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceConsentRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal)Property).TermOfServiceConsentRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal)Property).TermOfServiceConsentRequired = value ?? default(bool); } + + /// Display terms of service during a sign-up process. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal)Property).TermOfServiceEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal)Property).TermOfServiceEnabled = value ?? default(bool); } + + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TermOfServiceText { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal)Property).TermOfServiceText; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal)Property).TermOfServiceText = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public PortalSignupSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Sign-Up settings for a developer portal. + public partial interface IPortalSignupSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Allow users to sign up on a developer portal. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow users to sign up on a developer portal.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ask user for consent to the terms of service.", + SerializedName = @"consentRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceConsentRequired { get; set; } + /// Display terms of service during a sign-up process. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display terms of service during a sign-up process.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceEnabled { get; set; } + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A terms of service text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string TermOfServiceText { get; set; } + + } + /// Sign-Up settings for a developer portal. + internal partial interface IPortalSignupSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Allow users to sign up on a developer portal. + bool? Enabled { get; set; } + /// Sign-up settings contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsProperties Property { get; set; } + /// Ask user for consent to the terms of service. + bool? TermOfServiceConsentRequired { get; set; } + /// Display terms of service during a sign-up process. + bool? TermOfServiceEnabled { get; set; } + /// A terms of service text. + string TermOfServiceText { get; set; } + /// Terms of service contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties TermsOfService { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettings.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettings.json.cs new file mode 100644 index 000000000000..0c5d21e06663 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettings.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-Up settings for a developer portal. + public partial class PortalSignupSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalSignupSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalSignupSettings(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PortalSignupSettingsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettingsProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettingsProperties.cs new file mode 100644 index 000000000000..ecc70e4bca82 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettingsProperties.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-up settings contract properties. + public partial class PortalSignupSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Allow users to sign up on a developer portal. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Internal Acessors for TermsOfService + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsPropertiesInternal.TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TermsOfServiceProperties()); set { {_termsOfService = value;} } } + + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceConsentRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).ConsentRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).ConsentRequired = value ?? default(bool); } + + /// Display terms of service during a sign-up process. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? TermOfServiceEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).Enabled = value ?? default(bool); } + + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TermOfServiceText { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).Text; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal)TermsOfService).Text = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties _termsOfService; + + /// Terms of service contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties TermsOfService { get => (this._termsOfService = this._termsOfService ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TermsOfServiceProperties()); set => this._termsOfService = value; } + + /// Creates an new instance. + public PortalSignupSettingsProperties() + { + + } + } + /// Sign-up settings contract properties. + public partial interface IPortalSignupSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Allow users to sign up on a developer portal. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow users to sign up on a developer portal.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ask user for consent to the terms of service.", + SerializedName = @"consentRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceConsentRequired { get; set; } + /// Display terms of service during a sign-up process. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display terms of service during a sign-up process.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? TermOfServiceEnabled { get; set; } + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A terms of service text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string TermOfServiceText { get; set; } + + } + /// Sign-up settings contract properties. + internal partial interface IPortalSignupSettingsPropertiesInternal + + { + /// Allow users to sign up on a developer portal. + bool? Enabled { get; set; } + /// Ask user for consent to the terms of service. + bool? TermOfServiceConsentRequired { get; set; } + /// Display terms of service during a sign-up process. + bool? TermOfServiceEnabled { get; set; } + /// A terms of service text. + string TermOfServiceText { get; set; } + /// Terms of service contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties TermsOfService { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettingsProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettingsProperties.json.cs new file mode 100644 index 000000000000..c731a227dd46 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PortalSignupSettingsProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sign-up settings contract properties. + public partial class PortalSignupSettingsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPortalSignupSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalSignupSettingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalSignupSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_termsOfService = If( json?.PropertyT("termsOfService"), out var __jsonTermsOfService) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TermsOfServiceProperties.FromJson(__jsonTermsOfService) : TermsOfService;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._termsOfService ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._termsOfService.ToJson(null,serializationMode) : null, "termsOfService" ,container.Add ); + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequest.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequest.cs new file mode 100644 index 000000000000..efedb5f99221 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequest.cs @@ -0,0 +1,124 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A request to approve or reject a private endpoint connection + public partial class PrivateEndpointConnectionRequest : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequest, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestInternal + { + + /// Backing field for property. + private string _id; + + /// Private Endpoint Connection Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PrivateEndpointConnectionRequestProperties()); set { {_property = value;} } } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } + + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestProperties _property; + + /// The connection state of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PrivateEndpointConnectionRequestProperties()); set => this._property = value; } + + /// Creates an new instance. + public PrivateEndpointConnectionRequest() + { + + } + } + /// A request to approve or reject a private endpoint connection + public partial interface IPrivateEndpointConnectionRequest : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Private Endpoint Connection Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Private Endpoint Connection Resource Id.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + + } + /// A request to approve or reject a private endpoint connection + internal partial interface IPrivateEndpointConnectionRequestInternal + + { + /// Private Endpoint Connection Resource Id. + string Id { get; set; } + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The connection state of the private endpoint connection. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequest.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequest.json.cs new file mode 100644 index 000000000000..60d57e9be032 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequest.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A request to approve or reject a private endpoint connection + public partial class PrivateEndpointConnectionRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionRequest(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PrivateEndpointConnectionRequestProperties.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequestProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequestProperties.cs new file mode 100644 index 000000000000..e92c77d4a001 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequestProperties.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The connection state of the private endpoint connection. + public partial class PrivateEndpointConnectionRequestProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestPropertiesInternal + { + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; + + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired = value ?? null; } + + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// + /// Creates an new instance. + /// + public PrivateEndpointConnectionRequestProperties() + { + + } + } + /// The connection state of the private endpoint connection. + public partial interface IPrivateEndpointConnectionRequestProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + + } + /// The connection state of the private endpoint connection. + internal partial interface IPrivateEndpointConnectionRequestPropertiesInternal + + { + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequestProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequestProperties.json.cs new file mode 100644 index 000000000000..45ae57d659cb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionRequestProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The connection state of the private endpoint connection. + public partial class PrivateEndpointConnectionRequestProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionRequestProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionRequestProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : PrivateLinkServiceConnectionState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null,serializationMode) : null, "privateLinkServiceConnectionState" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionWrapperProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionWrapperProperties.cs new file mode 100644 index 000000000000..4c22907ae35b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionWrapperProperties.cs @@ -0,0 +1,174 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the PrivateEndpointConnectProperties. + public partial class PrivateEndpointConnectionWrapperProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal + { + + /// Backing field for property. + private string[] _groupId; + + /// All the Group ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] GroupId { get => this._groupId; } + + /// Internal Acessors for GroupId + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapper Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ArmIdWrapper()); set { {_privateEndpoint = value;} } } + + /// Internal Acessors for PrivateEndpointId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapperInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapperInternal)PrivateEndpoint).Id = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapper _privateEndpoint; + + /// The resource of private end point. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapper PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ArmIdWrapper()); set => this._privateEndpoint = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapperInternal)PrivateEndpoint).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; + + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired = value ?? null; } + + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// + /// Creates an new instance. + /// + public PrivateEndpointConnectionWrapperProperties() + { + + } + } + /// Properties of the PrivateEndpointConnectProperties. + public partial interface IPrivateEndpointConnectionWrapperProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// All the Group ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"All the Group ids.", + SerializedName = @"groupIds", + PossibleTypes = new [] { typeof(string) })] + string[] GroupId { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state of the private endpoint connection resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + + } + /// Properties of the PrivateEndpointConnectProperties. + internal partial interface IPrivateEndpointConnectionWrapperPropertiesInternal + + { + /// All the Group ids. + string[] GroupId { get; set; } + /// The resource of private end point. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapper PrivateEndpoint { get; set; } + + string PrivateEndpointId { get; set; } + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The provisioning state of the private endpoint connection resource. + string ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionWrapperProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionWrapperProperties.json.cs new file mode 100644 index 000000000000..311d2bbaf473 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/PrivateEndpointConnectionWrapperProperties.json.cs @@ -0,0 +1,130 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of the PrivateEndpointConnectProperties. + public partial class PrivateEndpointConnectionWrapperProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionWrapperProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionWrapperProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ArmIdWrapper.FromJson(__jsonPrivateEndpoint) : PrivateEndpoint;} + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : PrivateLinkServiceConnectionState;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_groupId = If( json?.PropertyT("groupIds"), out var __jsonGroupIds) ? If( __jsonGroupIds as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : GroupId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null,serializationMode) : null, "privateEndpoint" ,container.Add ); + AddIf( null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null,serializationMode) : null, "privateLinkServiceConnectionState" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._groupId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._groupId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("groupIds",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkCollection.cs new file mode 100644 index 000000000000..c0a93e5230ab --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Product-API link list representation. + public partial class ProductApiLinkCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ProductApiLinkCollection() + { + + } + } + /// Paged Product-API link list representation. + public partial interface IProductApiLinkCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract[] Value { get; set; } + + } + /// Paged Product-API link list representation. + internal partial interface IProductApiLinkCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkCollection.json.cs new file mode 100644 index 000000000000..fc1872a98cf9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Product-API link list representation. + public partial class ProductApiLinkCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductApiLinkCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductApiLinkCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContract.cs new file mode 100644 index 000000000000..5632d86a0722 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContract.cs @@ -0,0 +1,129 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product-API link details. + public partial class ProductApiLinkContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Full resource Id of an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractPropertiesInternal)Property).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractPropertiesInternal)Property).ApiId = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractProperties _property; + + /// Product-API link entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public ProductApiLinkContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Product-API link details. + public partial interface IProductApiLinkContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Full resource Id of an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Full resource Id of an API.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + /// Product-API link details. + internal partial interface IProductApiLinkContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Full resource Id of an API. + string ApiId { get; set; } + + string ETag { get; set; } + /// Product-API link entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContract.json.cs new file mode 100644 index 000000000000..3f564d2e89e4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product-API link details. + public partial class ProductApiLinkContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductApiLinkContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductApiLinkContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductApiLinkContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContractProperties.cs new file mode 100644 index 000000000000..9618f9a2cf84 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product-API link entity properties. + public partial class ProductApiLinkContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractPropertiesInternal + { + + /// Backing field for property. + private string _apiId; + + /// Full resource Id of an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiId { get => this._apiId; set => this._apiId = value; } + + /// Creates an new instance. + public ProductApiLinkContractProperties() + { + + } + } + /// Product-API link entity properties. + public partial interface IProductApiLinkContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Full resource Id of an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Full resource Id of an API.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + + } + /// Product-API link entity properties. + internal partial interface IProductApiLinkContractPropertiesInternal + + { + /// Full resource Id of an API. + string ApiId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContractProperties.json.cs new file mode 100644 index 000000000000..8fbe9cd82687 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductApiLinkContractProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product-API link entity properties. + public partial class ProductApiLinkContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductApiLinkContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductApiLinkContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductApiLinkContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_apiId = If( json?.PropertyT("apiId"), out var __jsonApiId) ? (string)__jsonApiId : (string)ApiId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._apiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiId.ToString()) : null, "apiId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductCollection.cs new file mode 100644 index 000000000000..8bac62207f65 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Products list representation. + public partial class ProductCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ProductCollection() + { + + } + } + /// Paged Products list representation. + public partial interface IProductCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract[] Value { get; set; } + + } + /// Paged Products list representation. + internal partial interface IProductCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductCollection.json.cs new file mode 100644 index 000000000000..10b4705c378e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Products list representation. + public partial class ProductCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContract.cs new file mode 100644 index 000000000000..3adc814bd5cd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContract.cs @@ -0,0 +1,270 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product details. + public partial class ProductContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? ApprovalRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).ApprovalRequired = value ?? default(bool); } + + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).Description = value ?? null; } + + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractProperties _property; + + /// Product entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContractProperties()); set => this._property = value; } + + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState)""); } + + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).SubscriptionRequired = value ?? default(bool); } + + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? SubscriptionsLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).SubscriptionsLimit = value ?? default(int); } + + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).Term = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public ProductContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Product details. + public partial interface IProductContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false.", + SerializedName = @"approvalRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? ApprovalRequired { get; set; } + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product description. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get; set; } + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as ""protected"" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as ""open"" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true.", + SerializedName = @"subscriptionRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionRequired { get; set; } + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false.", + SerializedName = @"subscriptionsLimit", + PossibleTypes = new [] { typeof(int) })] + int? SubscriptionsLimit { get; set; } + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process.", + SerializedName = @"terms", + PossibleTypes = new [] { typeof(string) })] + string Term { get; set; } + + } + /// Product details. + internal partial interface IProductContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + bool? ApprovalRequired { get; set; } + /// Product description. May include HTML formatting tags. + string Description { get; set; } + /// Product name. + string DisplayName { get; set; } + + string ETag { get; set; } + /// Product entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractProperties Property { get; set; } + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get; set; } + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + bool? SubscriptionRequired { get; set; } + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + int? SubscriptionsLimit { get; set; } + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + string Term { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContract.json.cs new file mode 100644 index 000000000000..c8910ea59601 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product details. + public partial class ProductContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContractProperties.cs new file mode 100644 index 000000000000..6268f5ce7e7f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContractProperties.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product profile. + public partial class ProductContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParameters __productEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductEntityBaseParameters(); + + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? ApprovalRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).ApprovalRequired = value ?? default(bool); } + + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState)""); } + + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionRequired = value ?? default(bool); } + + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public int? SubscriptionsLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionsLimit = value ?? default(int); } + + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Term = value ?? null; } + + /// Creates an new instance. + public ProductContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__productEntityBaseParameters), __productEntityBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__productEntityBaseParameters), __productEntityBaseParameters); + } + } + /// Product profile. + public partial interface IProductContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParameters + { + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Product name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + } + /// Product profile. + internal partial interface IProductContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal + { + /// Product name. + string DisplayName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContractProperties.json.cs new file mode 100644 index 000000000000..0bca865a0ea0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductContractProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product profile. + public partial class ProductContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __productEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductEntityBaseParameters(json); + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __productEntityBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductEntityBaseParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductEntityBaseParameters.cs new file mode 100644 index 000000000000..6d1efa4c21a2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductEntityBaseParameters.cs @@ -0,0 +1,193 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product Entity Base Parameters + public partial class ProductEntityBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal + { + + /// Backing field for property. + private bool? _approvalRequired; + + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? ApprovalRequired { get => this._approvalRequired; set => this._approvalRequired = value; } + + /// Backing field for property. + private string _description; + + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? _state; + + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get => this._state; set => this._state = value; } + + /// Backing field for property. + private bool? _subscriptionRequired; + + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? SubscriptionRequired { get => this._subscriptionRequired; set => this._subscriptionRequired = value; } + + /// Backing field for property. + private int? _subscriptionsLimit; + + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? SubscriptionsLimit { get => this._subscriptionsLimit; set => this._subscriptionsLimit = value; } + + /// Backing field for property. + private string _term; + + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Term { get => this._term; set => this._term = value; } + + /// Creates an new instance. + public ProductEntityBaseParameters() + { + + } + } + /// Product Entity Base Parameters + public partial interface IProductEntityBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false.", + SerializedName = @"approvalRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? ApprovalRequired { get; set; } + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product description. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get; set; } + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as ""protected"" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as ""open"" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true.", + SerializedName = @"subscriptionRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionRequired { get; set; } + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false.", + SerializedName = @"subscriptionsLimit", + PossibleTypes = new [] { typeof(int) })] + int? SubscriptionsLimit { get; set; } + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process.", + SerializedName = @"terms", + PossibleTypes = new [] { typeof(string) })] + string Term { get; set; } + + } + /// Product Entity Base Parameters + internal partial interface IProductEntityBaseParametersInternal + + { + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + bool? ApprovalRequired { get; set; } + /// Product description. May include HTML formatting tags. + string Description { get; set; } + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get; set; } + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + bool? SubscriptionRequired { get; set; } + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + int? SubscriptionsLimit { get; set; } + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + string Term { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductEntityBaseParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductEntityBaseParameters.json.cs new file mode 100644 index 000000000000..1b8914aa6493 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductEntityBaseParameters.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product Entity Base Parameters + public partial class ProductEntityBaseParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductEntityBaseParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductEntityBaseParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_term = If( json?.PropertyT("terms"), out var __jsonTerms) ? (string)__jsonTerms : (string)Term;} + {_subscriptionRequired = If( json?.PropertyT("subscriptionRequired"), out var __jsonSubscriptionRequired) ? (bool?)__jsonSubscriptionRequired : SubscriptionRequired;} + {_approvalRequired = If( json?.PropertyT("approvalRequired"), out var __jsonApprovalRequired) ? (bool?)__jsonApprovalRequired : ApprovalRequired;} + {_subscriptionsLimit = If( json?.PropertyT("subscriptionsLimit"), out var __jsonSubscriptionsLimit) ? (int?)__jsonSubscriptionsLimit : SubscriptionsLimit;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._term)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._term.ToString()) : null, "terms" ,container.Add ); + AddIf( null != this._subscriptionRequired ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._subscriptionRequired) : null, "subscriptionRequired" ,container.Add ); + AddIf( null != this._approvalRequired ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._approvalRequired) : null, "approvalRequired" ,container.Add ); + AddIf( null != this._subscriptionsLimit ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._subscriptionsLimit) : null, "subscriptionsLimit" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkCollection.cs new file mode 100644 index 000000000000..3e0d08621e98 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Product-group link list representation. + public partial class ProductGroupLinkCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ProductGroupLinkCollection() + { + + } + } + /// Paged Product-group link list representation. + public partial interface IProductGroupLinkCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract[] Value { get; set; } + + } + /// Paged Product-group link list representation. + internal partial interface IProductGroupLinkCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkCollection.json.cs new file mode 100644 index 000000000000..27703abd5f70 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Product-group link list representation. + public partial class ProductGroupLinkCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductGroupLinkCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductGroupLinkCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContract.cs new file mode 100644 index 000000000000..c4ed7dd74d58 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContract.cs @@ -0,0 +1,127 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product-group link details. + public partial class ProductGroupLinkContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Full resource Id of a group. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractPropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractPropertiesInternal)Property).GroupId = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractProperties _property; + + /// Product-group link entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public ProductGroupLinkContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Product-group link details. + public partial interface IProductGroupLinkContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Full resource Id of a group. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Full resource Id of a group.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + string GroupId { get; set; } + + } + /// Product-group link details. + internal partial interface IProductGroupLinkContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Full resource Id of a group. + string GroupId { get; set; } + /// Product-group link entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContract.json.cs new file mode 100644 index 000000000000..82bb0bec6434 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product-group link details. + public partial class ProductGroupLinkContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductGroupLinkContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductGroupLinkContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductGroupLinkContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContractProperties.cs new file mode 100644 index 000000000000..9e7df410aebd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product-group link entity properties. + public partial class ProductGroupLinkContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractPropertiesInternal + { + + /// Backing field for property. + private string _groupId; + + /// Full resource Id of a group. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string GroupId { get => this._groupId; set => this._groupId = value; } + + /// Creates an new instance. + public ProductGroupLinkContractProperties() + { + + } + } + /// Product-group link entity properties. + public partial interface IProductGroupLinkContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Full resource Id of a group. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Full resource Id of a group.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + string GroupId { get; set; } + + } + /// Product-group link entity properties. + internal partial interface IProductGroupLinkContractPropertiesInternal + + { + /// Full resource Id of a group. + string GroupId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContractProperties.json.cs new file mode 100644 index 000000000000..10cbcd50efd3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductGroupLinkContractProperties.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product-group link entity properties. + public partial class ProductGroupLinkContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductGroupLinkContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductGroupLinkContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductGroupLinkContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)GroupId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductTagResourceContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductTagResourceContractProperties.cs new file mode 100644 index 000000000000..40e96e4c9802 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductTagResourceContractProperties.cs @@ -0,0 +1,130 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product profile. + public partial class ProductTagResourceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParameters __productEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductEntityBaseParameters(); + + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? ApprovalRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).ApprovalRequired = value ?? default(bool); } + + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Description = value ?? null; } + + /// Backing field for property. + private string _id; + + /// Identifier of the product in the form of /products/{productId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _name; + + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState)""); } + + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionRequired = value ?? default(bool); } + + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public int? SubscriptionsLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionsLimit = value ?? default(int); } + + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Term = value ?? null; } + + /// Creates an new instance. + public ProductTagResourceContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__productEntityBaseParameters), __productEntityBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__productEntityBaseParameters), __productEntityBaseParameters); + } + } + /// Product profile. + public partial interface IProductTagResourceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParameters + { + /// Identifier of the product in the form of /products/{productId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the product in the form of /products/{productId}", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Product name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Product profile. + internal partial interface IProductTagResourceContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal + { + /// Identifier of the product in the form of /products/{productId} + string Id { get; set; } + /// Product name. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductTagResourceContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductTagResourceContractProperties.json.cs new file mode 100644 index 000000000000..d47eda393207 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductTagResourceContractProperties.json.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product profile. + public partial class ProductTagResourceContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductTagResourceContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductTagResourceContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __productEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductEntityBaseParameters(json); + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __productEntityBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateParameters.cs new file mode 100644 index 000000000000..b2c57136e70b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateParameters.cs @@ -0,0 +1,201 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product Update parameters. + public partial class ProductUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParametersInternal + { + + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? ApprovalRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).ApprovalRequired = value ?? default(bool); } + + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).Description = value ?? null; } + + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdatePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdatePropertiesInternal)Property).DisplayName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductUpdateProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateProperties _property; + + /// Product entity Update contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductUpdateProperties()); set => this._property = value; } + + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState)""); } + + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).SubscriptionRequired = value ?? default(bool); } + + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? SubscriptionsLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).SubscriptionsLimit = value ?? default(int); } + + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Property).Term = value ?? null; } + + /// Creates an new instance. + public ProductUpdateParameters() + { + + } + } + /// Product Update parameters. + public partial interface IProductUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false.", + SerializedName = @"approvalRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? ApprovalRequired { get; set; } + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product description. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get; set; } + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as ""protected"" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as ""open"" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true.", + SerializedName = @"subscriptionRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? SubscriptionRequired { get; set; } + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false.", + SerializedName = @"subscriptionsLimit", + PossibleTypes = new [] { typeof(int) })] + int? SubscriptionsLimit { get; set; } + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process.", + SerializedName = @"terms", + PossibleTypes = new [] { typeof(string) })] + string Term { get; set; } + + } + /// Product Update parameters. + internal partial interface IProductUpdateParametersInternal + + { + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + bool? ApprovalRequired { get; set; } + /// Product description. May include HTML formatting tags. + string Description { get; set; } + /// Product name. + string DisplayName { get; set; } + /// Product entity Update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateProperties Property { get; set; } + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get; set; } + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + bool? SubscriptionRequired { get; set; } + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + int? SubscriptionsLimit { get; set; } + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + string Term { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateParameters.json.cs new file mode 100644 index 000000000000..70b9acf7f684 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Product Update parameters. + public partial class ProductUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductUpdateProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateProperties.cs new file mode 100644 index 000000000000..40f133f061e7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateProperties.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Product operation. + public partial class ProductUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdatePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParameters __productEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductEntityBaseParameters(); + + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? ApprovalRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).ApprovalRequired = value ?? default(bool); } + + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState)""); } + + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public bool? SubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionRequired = value ?? default(bool); } + + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public int? SubscriptionsLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).SubscriptionsLimit = value ?? default(int); } + + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)__productEntityBaseParameters).Term = value ?? null; } + + /// Creates an new instance. + public ProductUpdateProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__productEntityBaseParameters), __productEntityBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__productEntityBaseParameters), __productEntityBaseParameters); + } + } + /// Parameters supplied to the Update Product operation. + public partial interface IProductUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParameters + { + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + } + /// Parameters supplied to the Update Product operation. + internal partial interface IProductUpdatePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal + { + /// Product name. + string DisplayName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateProperties.json.cs new file mode 100644 index 000000000000..1fd678343171 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ProductUpdateProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update Product operation. + public partial class ProductUpdateProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductUpdateProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __productEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductEntityBaseParameters(json); + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __productEntityBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterCollection.cs new file mode 100644 index 000000000000..0fa8a4f70cec --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Quota Counter list representation. + public partial class QuotaCounterCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContract[] _value; + + /// Quota counter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public QuotaCounterCollection() + { + + } + } + /// Paged Quota Counter list representation. + public partial interface IQuotaCounterCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Quota counter values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Quota counter values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContract[] Value { get; set; } + + } + /// Paged Quota Counter list representation. + internal partial interface IQuotaCounterCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Quota counter values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterCollection.json.cs new file mode 100644 index 000000000000..cc4e45ee0142 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Quota Counter list representation. + public partial class QuotaCounterCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new QuotaCounterCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal QuotaCounterCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterContract.cs new file mode 100644 index 000000000000..b9548e35bdb9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterContract.cs @@ -0,0 +1,168 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter details. + public partial class QuotaCounterContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContractInternal + { + + /// Backing field for property. + private string _counterKey; + + /// The Key value of the Counter. Must not be empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string CounterKey { get => this._counterKey; set => this._counterKey = value; } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContractInternal.Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterValueContractProperties()); set { {_value = value;} } } + + /// Backing field for property. + private global::System.DateTime _periodEndTime; + + /// + /// The date of the end of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime PeriodEndTime { get => this._periodEndTime; set => this._periodEndTime = value; } + + /// Backing field for property. + private string _periodKey; + + /// + /// Identifier of the Period for which the counter was collected. Must not be empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PeriodKey { get => this._periodKey; set => this._periodKey = value; } + + /// Backing field for property. + private global::System.DateTime _periodStartTime; + + /// + /// The date of the start of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime PeriodStartTime { get => this._periodStartTime; set => this._periodStartTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties _value; + + /// Quota Value Properties + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterValueContractProperties()); set => this._value = value; } + + /// Number of times Counter was called. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? ValueCallsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Value).CallsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Value).CallsCount = value ?? default(int); } + + /// Data Transferred in KiloBytes. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public double? ValueKbTransferred { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Value).KbTransferred; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Value).KbTransferred = value ?? default(double); } + + /// Creates an new instance. + public QuotaCounterContract() + { + + } + } + /// Quota counter details. + public partial interface IQuotaCounterContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The Key value of the Counter. Must not be empty. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Key value of the Counter. Must not be empty.", + SerializedName = @"counterKey", + PossibleTypes = new [] { typeof(string) })] + string CounterKey { get; set; } + /// + /// The date of the end of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The date of the end of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"periodEndTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime PeriodEndTime { get; set; } + /// + /// Identifier of the Period for which the counter was collected. Must not be empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Identifier of the Period for which the counter was collected. Must not be empty.", + SerializedName = @"periodKey", + PossibleTypes = new [] { typeof(string) })] + string PeriodKey { get; set; } + /// + /// The date of the start of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The date of the start of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"periodStartTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime PeriodStartTime { get; set; } + /// Number of times Counter was called. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of times Counter was called.", + SerializedName = @"callsCount", + PossibleTypes = new [] { typeof(int) })] + int? ValueCallsCount { get; set; } + /// Data Transferred in KiloBytes. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Transferred in KiloBytes.", + SerializedName = @"kbTransferred", + PossibleTypes = new [] { typeof(double) })] + double? ValueKbTransferred { get; set; } + + } + /// Quota counter details. + internal partial interface IQuotaCounterContractInternal + + { + /// The Key value of the Counter. Must not be empty. + string CounterKey { get; set; } + /// + /// The date of the end of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime PeriodEndTime { get; set; } + /// + /// Identifier of the Period for which the counter was collected. Must not be empty. + /// + string PeriodKey { get; set; } + /// + /// The date of the start of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime PeriodStartTime { get; set; } + /// Quota Value Properties + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties Value { get; set; } + /// Number of times Counter was called. + int? ValueCallsCount { get; set; } + /// Data Transferred in KiloBytes. + double? ValueKbTransferred { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterContract.json.cs new file mode 100644 index 000000000000..638159c4d0cd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterContract.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter details. + public partial class QuotaCounterContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new QuotaCounterContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal QuotaCounterContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterValueContractProperties.FromJson(__jsonValue) : Value;} + {_counterKey = If( json?.PropertyT("counterKey"), out var __jsonCounterKey) ? (string)__jsonCounterKey : (string)CounterKey;} + {_periodKey = If( json?.PropertyT("periodKey"), out var __jsonPeriodKey) ? (string)__jsonPeriodKey : (string)PeriodKey;} + {_periodStartTime = If( json?.PropertyT("periodStartTime"), out var __jsonPeriodStartTime) ? global::System.DateTime.TryParse((string)__jsonPeriodStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPeriodStartTimeValue) ? __jsonPeriodStartTimeValue : PeriodStartTime : PeriodStartTime;} + {_periodEndTime = If( json?.PropertyT("periodEndTime"), out var __jsonPeriodEndTime) ? global::System.DateTime.TryParse((string)__jsonPeriodEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPeriodEndTimeValue) ? __jsonPeriodEndTimeValue : PeriodEndTime : PeriodEndTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._value.ToJson(null,serializationMode) : null, "value" ,container.Add ); + AddIf( null != (((object)this._counterKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._counterKey.ToString()) : null, "counterKey" ,container.Add ); + AddIf( null != (((object)this._periodKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._periodKey.ToString()) : null, "periodKey" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._periodStartTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "periodStartTime" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._periodEndTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "periodEndTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContract.cs new file mode 100644 index 000000000000..7156365d8d79 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContract.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter value details. + public partial class QuotaCounterValueContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractInternal.Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterValueContractProperties()); set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties _value; + + /// Quota counter Value Properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties Value { get => (this._value = this._value ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterValueContractProperties()); set => this._value = value; } + + /// Number of times Counter was called. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? ValueCallsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Value).CallsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Value).CallsCount = value ?? default(int); } + + /// Data Transferred in KiloBytes. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public double? ValueKbTransferred { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Value).KbTransferred; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Value).KbTransferred = value ?? default(double); } + + /// Creates an new instance. + public QuotaCounterValueContract() + { + + } + } + /// Quota counter value details. + public partial interface IQuotaCounterValueContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Number of times Counter was called. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of times Counter was called.", + SerializedName = @"callsCount", + PossibleTypes = new [] { typeof(int) })] + int? ValueCallsCount { get; set; } + /// Data Transferred in KiloBytes. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Transferred in KiloBytes.", + SerializedName = @"kbTransferred", + PossibleTypes = new [] { typeof(double) })] + double? ValueKbTransferred { get; set; } + + } + /// Quota counter value details. + internal partial interface IQuotaCounterValueContractInternal + + { + /// Quota counter Value Properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties Value { get; set; } + /// Number of times Counter was called. + int? ValueCallsCount { get; set; } + /// Data Transferred in KiloBytes. + double? ValueKbTransferred { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContract.json.cs new file mode 100644 index 000000000000..9f4677d424c0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter value details. + public partial class QuotaCounterValueContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new QuotaCounterValueContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal QuotaCounterValueContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterValueContractProperties.FromJson(__jsonValue) : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._value.ToJson(null,serializationMode) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContractProperties.cs new file mode 100644 index 000000000000..6d30913ff641 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContractProperties.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter value details. + public partial class QuotaCounterValueContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal + { + + /// Backing field for property. + private int? _callsCount; + + /// Number of times Counter was called. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? CallsCount { get => this._callsCount; set => this._callsCount = value; } + + /// Backing field for property. + private double? _kbTransferred; + + /// Data Transferred in KiloBytes. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public double? KbTransferred { get => this._kbTransferred; set => this._kbTransferred = value; } + + /// Creates an new instance. + public QuotaCounterValueContractProperties() + { + + } + } + /// Quota counter value details. + public partial interface IQuotaCounterValueContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Number of times Counter was called. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of times Counter was called.", + SerializedName = @"callsCount", + PossibleTypes = new [] { typeof(int) })] + int? CallsCount { get; set; } + /// Data Transferred in KiloBytes. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Transferred in KiloBytes.", + SerializedName = @"kbTransferred", + PossibleTypes = new [] { typeof(double) })] + double? KbTransferred { get; set; } + + } + /// Quota counter value details. + internal partial interface IQuotaCounterValueContractPropertiesInternal + + { + /// Number of times Counter was called. + int? CallsCount { get; set; } + /// Data Transferred in KiloBytes. + double? KbTransferred { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContractProperties.json.cs new file mode 100644 index 000000000000..5d26c9bc4977 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueContractProperties.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter value details. + public partial class QuotaCounterValueContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new QuotaCounterValueContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal QuotaCounterValueContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_callsCount = If( json?.PropertyT("callsCount"), out var __jsonCallsCount) ? (int?)__jsonCallsCount : CallsCount;} + {_kbTransferred = If( json?.PropertyT("kbTransferred"), out var __jsonKbTransferred) ? (double?)__jsonKbTransferred : KbTransferred;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._callsCount ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._callsCount) : null, "callsCount" ,container.Add ); + AddIf( null != this._kbTransferred ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((double)this._kbTransferred) : null, "kbTransferred" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueUpdateContract.cs new file mode 100644 index 000000000000..1924c0b6fc49 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueUpdateContract.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter value details. + public partial class QuotaCounterValueUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContractInternal + { + + /// Number of times Counter was called. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? CallsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Property).CallsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Property).CallsCount = value ?? default(int); } + + /// Data Transferred in KiloBytes. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public double? KbTransferred { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Property).KbTransferred; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractPropertiesInternal)Property).KbTransferred = value ?? default(double); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterValueContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties _property; + + /// Quota counter value details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterValueContractProperties()); set => this._property = value; } + + /// Creates an new instance. + public QuotaCounterValueUpdateContract() + { + + } + } + /// Quota counter value details. + public partial interface IQuotaCounterValueUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Number of times Counter was called. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of times Counter was called.", + SerializedName = @"callsCount", + PossibleTypes = new [] { typeof(int) })] + int? CallsCount { get; set; } + /// Data Transferred in KiloBytes. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data Transferred in KiloBytes.", + SerializedName = @"kbTransferred", + PossibleTypes = new [] { typeof(double) })] + double? KbTransferred { get; set; } + + } + /// Quota counter value details. + internal partial interface IQuotaCounterValueUpdateContractInternal + + { + /// Number of times Counter was called. + int? CallsCount { get; set; } + /// Data Transferred in KiloBytes. + double? KbTransferred { get; set; } + /// Quota counter value details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueUpdateContract.json.cs new file mode 100644 index 000000000000..ea6b2b9793f7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/QuotaCounterValueUpdateContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Quota counter value details. + public partial class QuotaCounterValueUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IQuotaCounterValueUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new QuotaCounterValueUpdateContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal QuotaCounterValueUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.QuotaCounterValueContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailCollection.cs new file mode 100644 index 000000000000..d2716aaddf46 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Recipient User list representation. + public partial class RecipientEmailCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public RecipientEmailCollection() + { + + } + } + /// Paged Recipient User list representation. + public partial interface IRecipientEmailCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContract[] Value { get; set; } + + } + /// Paged Recipient User list representation. + internal partial interface IRecipientEmailCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailCollection.json.cs new file mode 100644 index 000000000000..4f111eeab634 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Recipient User list representation. + public partial class RecipientEmailCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RecipientEmailCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RecipientEmailCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientEmailContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContract.cs new file mode 100644 index 000000000000..5debc78c6a51 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContract.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient Email details. + public partial class RecipientEmailContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// User Email subscribed to notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Email { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractPropertiesInternal)Property).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractPropertiesInternal)Property).Email = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientEmailContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractProperties _property; + + /// Recipient Email contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientEmailContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public RecipientEmailContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Recipient Email details. + public partial interface IRecipientEmailContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// User Email subscribed to notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User Email subscribed to notification.", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string Email { get; set; } + + } + /// Recipient Email details. + internal partial interface IRecipientEmailContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// User Email subscribed to notification. + string Email { get; set; } + /// Recipient Email contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContract.json.cs new file mode 100644 index 000000000000..ab16dde2ebc6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient Email details. + public partial class RecipientEmailContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RecipientEmailContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RecipientEmailContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientEmailContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContractProperties.cs new file mode 100644 index 000000000000..5da77d6cee30 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient Email Contract Properties. + public partial class RecipientEmailContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractPropertiesInternal + { + + /// Backing field for property. + private string _email; + + /// User Email subscribed to notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Email { get => this._email; set => this._email = value; } + + /// Creates an new instance. + public RecipientEmailContractProperties() + { + + } + } + /// Recipient Email Contract Properties. + public partial interface IRecipientEmailContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// User Email subscribed to notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User Email subscribed to notification.", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string Email { get; set; } + + } + /// Recipient Email Contract Properties. + internal partial interface IRecipientEmailContractPropertiesInternal + + { + /// User Email subscribed to notification. + string Email { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContractProperties.json.cs new file mode 100644 index 000000000000..463fcdfccf0e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientEmailContractProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient Email Contract Properties. + public partial class RecipientEmailContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientEmailContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RecipientEmailContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RecipientEmailContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._email)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._email.ToString()) : null, "email" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserCollection.cs new file mode 100644 index 000000000000..1811beab4e3d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Recipient User list representation. + public partial class RecipientUserCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public RecipientUserCollection() + { + + } + } + /// Paged Recipient User list representation. + public partial interface IRecipientUserCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContract[] Value { get; set; } + + } + /// Paged Recipient User list representation. + internal partial interface IRecipientUserCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserCollection.json.cs new file mode 100644 index 000000000000..560ebb7988f1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Recipient User list representation. + public partial class RecipientUserCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RecipientUserCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RecipientUserCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientUserContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserContract.cs new file mode 100644 index 000000000000..9985ba23f772 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserContract.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient User details. + public partial class RecipientUserContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientUsersContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractProperties _property; + + /// Recipient User entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientUsersContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// API Management UserId subscribed to notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractPropertiesInternal)Property).UserId = value ?? null; } + + /// Creates an new instance. + public RecipientUserContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Recipient User details. + public partial interface IRecipientUserContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// API Management UserId subscribed to notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API Management UserId subscribed to notification.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; set; } + + } + /// Recipient User details. + internal partial interface IRecipientUserContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Recipient User entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractProperties Property { get; set; } + /// API Management UserId subscribed to notification. + string UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserContract.json.cs new file mode 100644 index 000000000000..c44ff1b7631b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUserContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient User details. + public partial class RecipientUserContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUserContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RecipientUserContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RecipientUserContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RecipientUsersContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUsersContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUsersContractProperties.cs new file mode 100644 index 000000000000..653a5a8a9830 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUsersContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient User Contract Properties. + public partial class RecipientUsersContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractPropertiesInternal + { + + /// Backing field for property. + private string _userId; + + /// API Management UserId subscribed to notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UserId { get => this._userId; set => this._userId = value; } + + /// Creates an new instance. + public RecipientUsersContractProperties() + { + + } + } + /// Recipient User Contract Properties. + public partial interface IRecipientUsersContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// API Management UserId subscribed to notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API Management UserId subscribed to notification.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; set; } + + } + /// Recipient User Contract Properties. + internal partial interface IRecipientUsersContractPropertiesInternal + + { + /// API Management UserId subscribed to notification. + string UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUsersContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUsersContractProperties.json.cs new file mode 100644 index 000000000000..4412c3352b64 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientUsersContractProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Recipient User Contract Properties. + public partial class RecipientUsersContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientUsersContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RecipientUsersContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RecipientUsersContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._userId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._userId.ToString()) : null, "userId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientsContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientsContractProperties.cs new file mode 100644 index 000000000000..8eaf4985dd9c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientsContractProperties.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Notification Parameter contract. + public partial class RecipientsContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractPropertiesInternal + { + + /// Backing field for property. + private string[] _email; + + /// List of Emails subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] Email { get => this._email; set => this._email = value; } + + /// Backing field for property. + private string[] _user; + + /// List of Users subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string[] User { get => this._user; set => this._user = value; } + + /// Creates an new instance. + public RecipientsContractProperties() + { + + } + } + /// Notification Parameter contract. + public partial interface IRecipientsContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// List of Emails subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Emails subscribed for the notification.", + SerializedName = @"emails", + PossibleTypes = new [] { typeof(string) })] + string[] Email { get; set; } + /// List of Users subscribed for the notification. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Users subscribed for the notification.", + SerializedName = @"users", + PossibleTypes = new [] { typeof(string) })] + string[] User { get; set; } + + } + /// Notification Parameter contract. + internal partial interface IRecipientsContractPropertiesInternal + + { + /// List of Emails subscribed for the notification. + string[] Email { get; set; } + /// List of Users subscribed for the notification. + string[] User { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientsContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientsContractProperties.json.cs new file mode 100644 index 000000000000..620e99004e45 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RecipientsContractProperties.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Notification Parameter contract. + public partial class RecipientsContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRecipientsContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RecipientsContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RecipientsContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_email = If( json?.PropertyT("emails"), out var __jsonEmails) ? If( __jsonEmails as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Email;} + {_user = If( json?.PropertyT("users"), out var __jsonUsers) ? If( __jsonUsers as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : User;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._email) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._email ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("emails",__w); + } + if (null != this._user) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._user ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("users",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionContract.cs new file mode 100644 index 000000000000..d7f050b0cf67 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionContract.cs @@ -0,0 +1,88 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Region profile. + public partial class RegionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContractInternal + { + + /// Backing field for property. + private bool? _isDeleted; + + /// whether Region is deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsDeleted { get => this._isDeleted; set => this._isDeleted = value; } + + /// Backing field for property. + private bool? _isMasterRegion; + + /// whether Region is the master region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsMasterRegion { get => this._isMasterRegion; set => this._isMasterRegion = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContractInternal.Name { get => this._name; set { {_name = value;} } } + + /// Backing field for property. + private string _name; + + /// Region name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Creates an new instance. + public RegionContract() + { + + } + } + /// Region profile. + public partial interface IRegionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// whether Region is deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether Region is deleted.", + SerializedName = @"isDeleted", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDeleted { get; set; } + /// whether Region is the master region. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether Region is the master region.", + SerializedName = @"isMasterRegion", + PossibleTypes = new [] { typeof(bool) })] + bool? IsMasterRegion { get; set; } + /// Region name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Region name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + + } + /// Region profile. + internal partial interface IRegionContractInternal + + { + /// whether Region is deleted. + bool? IsDeleted { get; set; } + /// whether Region is the master region. + bool? IsMasterRegion { get; set; } + /// Region name. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionContract.json.cs new file mode 100644 index 000000000000..1fc4243f3f7c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionContract.json.cs @@ -0,0 +1,115 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Region profile. + public partial class RegionContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RegionContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RegionContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_isMasterRegion = If( json?.PropertyT("isMasterRegion"), out var __jsonIsMasterRegion) ? (bool?)__jsonIsMasterRegion : IsMasterRegion;} + {_isDeleted = If( json?.PropertyT("isDeleted"), out var __jsonIsDeleted) ? (bool?)__jsonIsDeleted : IsDeleted;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + AddIf( null != this._isMasterRegion ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isMasterRegion) : null, "isMasterRegion" ,container.Add ); + AddIf( null != this._isDeleted ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isDeleted) : null, "isDeleted" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionListResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionListResult.cs new file mode 100644 index 000000000000..c0121711a1c9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionListResult.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Lists Regions operation response details. + public partial class RegionListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionListResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionListResultInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContract[] _value; + + /// Lists of Regions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public RegionListResult() + { + + } + } + /// Lists Regions operation response details. + public partial interface IRegionListResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Lists of Regions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Lists of Regions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContract[] Value { get; set; } + + } + /// Lists Regions operation response details. + internal partial interface IRegionListResultInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Lists of Regions. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionListResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionListResult.json.cs new file mode 100644 index 000000000000..7fe9c9767680 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegionListResult.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Lists Regions operation response details. + public partial class RegionListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RegionListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RegionListResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RegionContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegistrationDelegationSettingsProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegistrationDelegationSettingsProperties.cs new file mode 100644 index 000000000000..fe18f2489713 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegistrationDelegationSettingsProperties.cs @@ -0,0 +1,53 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User registration delegation settings properties. + public partial class RegistrationDelegationSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsPropertiesInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public RegistrationDelegationSettingsProperties() + { + + } + } + /// User registration delegation settings properties. + public partial interface IRegistrationDelegationSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Enable or disable delegation for user registration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for user registration.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// User registration delegation settings properties. + internal partial interface IRegistrationDelegationSettingsPropertiesInternal + + { + /// Enable or disable delegation for user registration. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegistrationDelegationSettingsProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegistrationDelegationSettingsProperties.json.cs new file mode 100644 index 000000000000..785a3965a772 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RegistrationDelegationSettingsProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User registration delegation settings properties. + public partial class RegistrationDelegationSettingsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRegistrationDelegationSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RegistrationDelegationSettingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RegistrationDelegationSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RemotePrivateEndpointConnectionWrapper.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RemotePrivateEndpointConnectionWrapper.cs new file mode 100644 index 000000000000..ce70c71c6c6c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RemotePrivateEndpointConnectionWrapper.cs @@ -0,0 +1,213 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Remote Private Endpoint Connection resource. + public partial class RemotePrivateEndpointConnectionWrapper : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapperInternal + { + + /// All the Group ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string[] GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).GroupId; } + + /// Backing field for property. + private string _id; + + /// Private Endpoint connection resource id + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Internal Acessors for GroupId + string[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapperInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).GroupId = value; } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapper Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapperInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateEndpoint = value; } + + /// Internal Acessors for PrivateEndpointId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapperInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateEndpointId = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapperInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapperInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PrivateEndpointConnectionWrapperProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapperInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).ProvisioningState = value; } + + /// Backing field for property. + private string _name; + + /// Private Endpoint Connection Name + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateEndpointId; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } + + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperProperties _property; + + /// Resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PrivateEndpointConnectionWrapperProperties()); set => this._property = value; } + + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperPropertiesInternal)Property).ProvisioningState; } + + /// Backing field for property. + private string _type; + + /// Private Endpoint Connection Resource Type + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public RemotePrivateEndpointConnectionWrapper() + { + + } + } + /// Remote Private Endpoint Connection resource. + public partial interface IRemotePrivateEndpointConnectionWrapper : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// All the Group ids. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"All the Group ids.", + SerializedName = @"groupIds", + PossibleTypes = new [] { typeof(string) })] + string[] GroupId { get; } + /// Private Endpoint connection resource id + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Private Endpoint connection resource id", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Private Endpoint Connection Name + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Private Endpoint Connection Name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionsRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state of the private endpoint connection resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Private Endpoint Connection Resource Type + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Private Endpoint Connection Resource Type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// Remote Private Endpoint Connection resource. + internal partial interface IRemotePrivateEndpointConnectionWrapperInternal + + { + /// All the Group ids. + string[] GroupId { get; set; } + /// Private Endpoint connection resource id + string Id { get; set; } + /// Private Endpoint Connection Name + string Name { get; set; } + /// The resource of private end point. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IArmIdWrapper PrivateEndpoint { get; set; } + + string PrivateEndpointId { get; set; } + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + string PrivateLinkServiceConnectionStateActionsRequired { get; set; } + /// The reason for approval/rejection of the connection. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// Resource properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IPrivateEndpointConnectionWrapperProperties Property { get; set; } + /// The provisioning state of the private endpoint connection resource. + string ProvisioningState { get; set; } + /// Private Endpoint Connection Resource Type + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RemotePrivateEndpointConnectionWrapper.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RemotePrivateEndpointConnectionWrapper.json.cs new file mode 100644 index 000000000000..0779abfa740b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RemotePrivateEndpointConnectionWrapper.json.cs @@ -0,0 +1,115 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Remote Private Endpoint Connection resource. + public partial class RemotePrivateEndpointConnectionWrapper + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRemotePrivateEndpointConnectionWrapper FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RemotePrivateEndpointConnectionWrapper(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RemotePrivateEndpointConnectionWrapper(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.PrivateEndpointConnectionWrapperProperties.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportCollection.cs new file mode 100644 index 000000000000..c2c52bcf2bab --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Report records list representation. + public partial class ReportCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ReportCollection() + { + + } + } + /// Paged Report records list representation. + public partial interface IReportCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContract[] Value { get; set; } + + } + /// Paged Report records list representation. + internal partial interface IReportCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportCollection.json.cs new file mode 100644 index 000000000000..b94f169aeb07 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Report records list representation. + public partial class ReportCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ReportCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ReportCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ReportRecordContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportRecordContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportRecordContract.cs new file mode 100644 index 000000000000..aeae45f9a6be --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportRecordContract.cs @@ -0,0 +1,531 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Report data. + public partial class ReportRecordContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContractInternal + { + + /// Backing field for property. + private string _apiId; + + /// API identifier path. /apis/{apiId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiId { get => this._apiId; set => this._apiId = value; } + + /// Backing field for property. + private string _apiRegion; + + /// API region identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiRegion { get => this._apiRegion; set => this._apiRegion = value; } + + /// Backing field for property. + private double? _apiTimeAvg; + + /// Average time it took to process request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public double? ApiTimeAvg { get => this._apiTimeAvg; set => this._apiTimeAvg = value; } + + /// Backing field for property. + private double? _apiTimeMax; + + /// Maximum time it took to process request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public double? ApiTimeMax { get => this._apiTimeMax; set => this._apiTimeMax = value; } + + /// Backing field for property. + private double? _apiTimeMin; + + /// Minimum time it took to process request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public double? ApiTimeMin { get => this._apiTimeMin; set => this._apiTimeMin = value; } + + /// Backing field for property. + private long? _bandwidth; + + /// Bandwidth consumed. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Bandwidth { get => this._bandwidth; set => this._bandwidth = value; } + + /// Backing field for property. + private int? _cacheHitCount; + + /// Number of times when content was served from cache policy. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? CacheHitCount { get => this._cacheHitCount; set => this._cacheHitCount = value; } + + /// Backing field for property. + private int? _cacheMissCount; + + /// Number of times content was fetched from backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? CacheMissCount { get => this._cacheMissCount; set => this._cacheMissCount = value; } + + /// Backing field for property. + private int? _callCountBlocked; + + /// + /// Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden + /// and HttpStatusCode.TooManyRequests + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? CallCountBlocked { get => this._callCountBlocked; set => this._callCountBlocked = value; } + + /// Backing field for property. + private int? _callCountFailed; + + /// + /// Number of calls failed due to gateway or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) + /// and any Code between HttpStatusCode.InternalServerError (500) and 600 + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? CallCountFailed { get => this._callCountFailed; set => this._callCountFailed = value; } + + /// Backing field for property. + private int? _callCountOther; + + /// Number of other calls. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? CallCountOther { get => this._callCountOther; set => this._callCountOther = value; } + + /// Backing field for property. + private int? _callCountSuccess; + + /// + /// Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? CallCountSuccess { get => this._callCountSuccess; set => this._callCountSuccess = value; } + + /// Backing field for property. + private int? _callCountTotal; + + /// Total number of calls. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? CallCountTotal { get => this._callCountTotal; set => this._callCountTotal = value; } + + /// Backing field for property. + private string _country; + + /// Country to which this record data is related. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Country { get => this._country; set => this._country = value; } + + /// Backing field for property. + private string _interval; + + /// + /// Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO + /// 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Interval { get => this._interval; set => this._interval = value; } + + /// Internal Acessors for ProductId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContractInternal.ProductId { get => this._productId; set { {_productId = value;} } } + + /// Internal Acessors for UserId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContractInternal.UserId { get => this._userId; set { {_userId = value;} } } + + /// Backing field for property. + private string _name; + + /// + /// Name depending on report endpoint specifies product, API, operation or developer name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _operationId; + + /// Operation identifier path. /apis/{apiId}/operations/{operationId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// Backing field for property. + private string _productId; + + /// Product identifier path. /products/{productId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProductId { get => this._productId; } + + /// Backing field for property. + private string _region; + + /// Country region to which this record data is related. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Region { get => this._region; set => this._region = value; } + + /// Backing field for property. + private double? _serviceTimeAvg; + + /// Average time it took to process request on backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public double? ServiceTimeAvg { get => this._serviceTimeAvg; set => this._serviceTimeAvg = value; } + + /// Backing field for property. + private double? _serviceTimeMax; + + /// Maximum time it took to process request on backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public double? ServiceTimeMax { get => this._serviceTimeMax; set => this._serviceTimeMax = value; } + + /// Backing field for property. + private double? _serviceTimeMin; + + /// Minimum time it took to process request on backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public double? ServiceTimeMin { get => this._serviceTimeMin; set => this._serviceTimeMin = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription identifier path. /subscriptions/{subscriptionId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private global::System.DateTime? _timestamp; + + /// + /// Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? Timestamp { get => this._timestamp; set => this._timestamp = value; } + + /// Backing field for property. + private string _userId; + + /// User identifier path. /users/{userId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UserId { get => this._userId; } + + /// Backing field for property. + private string _zip; + + /// Zip code to which this record data is related. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Zip { get => this._zip; set => this._zip = value; } + + /// Creates an new instance. + public ReportRecordContract() + { + + } + } + /// Report data. + public partial interface IReportRecordContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// API identifier path. /apis/{apiId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API identifier path. /apis/{apiId}", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + /// API region identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API region identifier.", + SerializedName = @"apiRegion", + PossibleTypes = new [] { typeof(string) })] + string ApiRegion { get; set; } + /// Average time it took to process request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Average time it took to process request.", + SerializedName = @"apiTimeAvg", + PossibleTypes = new [] { typeof(double) })] + double? ApiTimeAvg { get; set; } + /// Maximum time it took to process request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum time it took to process request.", + SerializedName = @"apiTimeMax", + PossibleTypes = new [] { typeof(double) })] + double? ApiTimeMax { get; set; } + /// Minimum time it took to process request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Minimum time it took to process request.", + SerializedName = @"apiTimeMin", + PossibleTypes = new [] { typeof(double) })] + double? ApiTimeMin { get; set; } + /// Bandwidth consumed. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Bandwidth consumed.", + SerializedName = @"bandwidth", + PossibleTypes = new [] { typeof(long) })] + long? Bandwidth { get; set; } + /// Number of times when content was served from cache policy. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of times when content was served from cache policy.", + SerializedName = @"cacheHitCount", + PossibleTypes = new [] { typeof(int) })] + int? CacheHitCount { get; set; } + /// Number of times content was fetched from backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of times content was fetched from backend.", + SerializedName = @"cacheMissCount", + PossibleTypes = new [] { typeof(int) })] + int? CacheMissCount { get; set; } + /// + /// Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden + /// and HttpStatusCode.TooManyRequests + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests", + SerializedName = @"callCountBlocked", + PossibleTypes = new [] { typeof(int) })] + int? CallCountBlocked { get; set; } + /// + /// Number of calls failed due to gateway or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) + /// and any Code between HttpStatusCode.InternalServerError (500) and 600 + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of calls failed due to gateway or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600", + SerializedName = @"callCountFailed", + PossibleTypes = new [] { typeof(int) })] + int? CallCountFailed { get; set; } + /// Number of other calls. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of other calls.", + SerializedName = @"callCountOther", + PossibleTypes = new [] { typeof(int) })] + int? CallCountOther { get; set; } + /// + /// Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect", + SerializedName = @"callCountSuccess", + PossibleTypes = new [] { typeof(int) })] + int? CallCountSuccess { get; set; } + /// Total number of calls. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total number of calls.", + SerializedName = @"callCountTotal", + PossibleTypes = new [] { typeof(int) })] + int? CallCountTotal { get; set; } + /// Country to which this record data is related. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Country to which this record data is related.", + SerializedName = @"country", + PossibleTypes = new [] { typeof(string) })] + string Country { get; set; } + /// + /// Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO + /// 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).", + SerializedName = @"interval", + PossibleTypes = new [] { typeof(string) })] + string Interval { get; set; } + /// + /// Name depending on report endpoint specifies product, API, operation or developer name. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name depending on report endpoint specifies product, API, operation or developer name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Operation identifier path. /apis/{apiId}/operations/{operationId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation identifier path. /apis/{apiId}/operations/{operationId}", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + /// Product identifier path. /products/{productId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Product identifier path. /products/{productId}", + SerializedName = @"productId", + PossibleTypes = new [] { typeof(string) })] + string ProductId { get; } + /// Country region to which this record data is related. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Country region to which this record data is related.", + SerializedName = @"region", + PossibleTypes = new [] { typeof(string) })] + string Region { get; set; } + /// Average time it took to process request on backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Average time it took to process request on backend.", + SerializedName = @"serviceTimeAvg", + PossibleTypes = new [] { typeof(double) })] + double? ServiceTimeAvg { get; set; } + /// Maximum time it took to process request on backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Maximum time it took to process request on backend.", + SerializedName = @"serviceTimeMax", + PossibleTypes = new [] { typeof(double) })] + double? ServiceTimeMax { get; set; } + /// Minimum time it took to process request on backend. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Minimum time it took to process request on backend.", + SerializedName = @"serviceTimeMin", + PossibleTypes = new [] { typeof(double) })] + double? ServiceTimeMin { get; set; } + /// Subscription identifier path. /subscriptions/{subscriptionId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription identifier path. /subscriptions/{subscriptionId}", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// + /// Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"timestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Timestamp { get; set; } + /// User identifier path. /users/{userId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"User identifier path. /users/{userId}", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; } + /// Zip code to which this record data is related. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Zip code to which this record data is related.", + SerializedName = @"zip", + PossibleTypes = new [] { typeof(string) })] + string Zip { get; set; } + + } + /// Report data. + internal partial interface IReportRecordContractInternal + + { + /// API identifier path. /apis/{apiId} + string ApiId { get; set; } + /// API region identifier. + string ApiRegion { get; set; } + /// Average time it took to process request. + double? ApiTimeAvg { get; set; } + /// Maximum time it took to process request. + double? ApiTimeMax { get; set; } + /// Minimum time it took to process request. + double? ApiTimeMin { get; set; } + /// Bandwidth consumed. + long? Bandwidth { get; set; } + /// Number of times when content was served from cache policy. + int? CacheHitCount { get; set; } + /// Number of times content was fetched from backend. + int? CacheMissCount { get; set; } + /// + /// Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden + /// and HttpStatusCode.TooManyRequests + /// + int? CallCountBlocked { get; set; } + /// + /// Number of calls failed due to gateway or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) + /// and any Code between HttpStatusCode.InternalServerError (500) and 600 + /// + int? CallCountFailed { get; set; } + /// Number of other calls. + int? CallCountOther { get; set; } + /// + /// Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect + /// + int? CallCountSuccess { get; set; } + /// Total number of calls. + int? CallCountTotal { get; set; } + /// Country to which this record data is related. + string Country { get; set; } + /// + /// Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO + /// 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + /// + string Interval { get; set; } + /// + /// Name depending on report endpoint specifies product, API, operation or developer name. + /// + string Name { get; set; } + /// Operation identifier path. /apis/{apiId}/operations/{operationId} + string OperationId { get; set; } + /// Product identifier path. /products/{productId} + string ProductId { get; set; } + /// Country region to which this record data is related. + string Region { get; set; } + /// Average time it took to process request on backend. + double? ServiceTimeAvg { get; set; } + /// Maximum time it took to process request on backend. + double? ServiceTimeMax { get; set; } + /// Minimum time it took to process request on backend. + double? ServiceTimeMin { get; set; } + /// Subscription identifier path. /subscriptions/{subscriptionId} + string SubscriptionId { get; set; } + /// + /// Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? Timestamp { get; set; } + /// User identifier path. /users/{userId} + string UserId { get; set; } + /// Zip code to which this record data is related. + string Zip { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportRecordContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportRecordContract.json.cs new file mode 100644 index 000000000000..de9ffd2ee882 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ReportRecordContract.json.cs @@ -0,0 +1,164 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Report data. + public partial class ReportRecordContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IReportRecordContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ReportRecordContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ReportRecordContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_timestamp = If( json?.PropertyT("timestamp"), out var __jsonTimestamp) ? global::System.DateTime.TryParse((string)__jsonTimestamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimestampValue) ? __jsonTimestampValue : Timestamp : Timestamp;} + {_interval = If( json?.PropertyT("interval"), out var __jsonInterval) ? (string)__jsonInterval : (string)Interval;} + {_country = If( json?.PropertyT("country"), out var __jsonCountry) ? (string)__jsonCountry : (string)Country;} + {_region = If( json?.PropertyT("region"), out var __jsonRegion) ? (string)__jsonRegion : (string)Region;} + {_zip = If( json?.PropertyT("zip"), out var __jsonZip) ? (string)__jsonZip : (string)Zip;} + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} + {_productId = If( json?.PropertyT("productId"), out var __jsonProductId) ? (string)__jsonProductId : (string)ProductId;} + {_apiId = If( json?.PropertyT("apiId"), out var __jsonApiId) ? (string)__jsonApiId : (string)ApiId;} + {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} + {_apiRegion = If( json?.PropertyT("apiRegion"), out var __jsonApiRegion) ? (string)__jsonApiRegion : (string)ApiRegion;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_callCountSuccess = If( json?.PropertyT("callCountSuccess"), out var __jsonCallCountSuccess) ? (int?)__jsonCallCountSuccess : CallCountSuccess;} + {_callCountBlocked = If( json?.PropertyT("callCountBlocked"), out var __jsonCallCountBlocked) ? (int?)__jsonCallCountBlocked : CallCountBlocked;} + {_callCountFailed = If( json?.PropertyT("callCountFailed"), out var __jsonCallCountFailed) ? (int?)__jsonCallCountFailed : CallCountFailed;} + {_callCountOther = If( json?.PropertyT("callCountOther"), out var __jsonCallCountOther) ? (int?)__jsonCallCountOther : CallCountOther;} + {_callCountTotal = If( json?.PropertyT("callCountTotal"), out var __jsonCallCountTotal) ? (int?)__jsonCallCountTotal : CallCountTotal;} + {_bandwidth = If( json?.PropertyT("bandwidth"), out var __jsonBandwidth) ? (long?)__jsonBandwidth : Bandwidth;} + {_cacheHitCount = If( json?.PropertyT("cacheHitCount"), out var __jsonCacheHitCount) ? (int?)__jsonCacheHitCount : CacheHitCount;} + {_cacheMissCount = If( json?.PropertyT("cacheMissCount"), out var __jsonCacheMissCount) ? (int?)__jsonCacheMissCount : CacheMissCount;} + {_apiTimeAvg = If( json?.PropertyT("apiTimeAvg"), out var __jsonApiTimeAvg) ? (double?)__jsonApiTimeAvg : ApiTimeAvg;} + {_apiTimeMin = If( json?.PropertyT("apiTimeMin"), out var __jsonApiTimeMin) ? (double?)__jsonApiTimeMin : ApiTimeMin;} + {_apiTimeMax = If( json?.PropertyT("apiTimeMax"), out var __jsonApiTimeMax) ? (double?)__jsonApiTimeMax : ApiTimeMax;} + {_serviceTimeAvg = If( json?.PropertyT("serviceTimeAvg"), out var __jsonServiceTimeAvg) ? (double?)__jsonServiceTimeAvg : ServiceTimeAvg;} + {_serviceTimeMin = If( json?.PropertyT("serviceTimeMin"), out var __jsonServiceTimeMin) ? (double?)__jsonServiceTimeMin : ServiceTimeMin;} + {_serviceTimeMax = If( json?.PropertyT("serviceTimeMax"), out var __jsonServiceTimeMax) ? (double?)__jsonServiceTimeMax : ServiceTimeMax;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != this._timestamp ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._timestamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "timestamp" ,container.Add ); + AddIf( null != (((object)this._interval)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._interval.ToString()) : null, "interval" ,container.Add ); + AddIf( null != (((object)this._country)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._country.ToString()) : null, "country" ,container.Add ); + AddIf( null != (((object)this._region)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._region.ToString()) : null, "region" ,container.Add ); + AddIf( null != (((object)this._zip)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._zip.ToString()) : null, "zip" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._userId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._userId.ToString()) : null, "userId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._productId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._productId.ToString()) : null, "productId" ,container.Add ); + } + AddIf( null != (((object)this._apiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiId.ToString()) : null, "apiId" ,container.Add ); + AddIf( null != (((object)this._operationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._operationId.ToString()) : null, "operationId" ,container.Add ); + AddIf( null != (((object)this._apiRegion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiRegion.ToString()) : null, "apiRegion" ,container.Add ); + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != this._callCountSuccess ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._callCountSuccess) : null, "callCountSuccess" ,container.Add ); + AddIf( null != this._callCountBlocked ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._callCountBlocked) : null, "callCountBlocked" ,container.Add ); + AddIf( null != this._callCountFailed ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._callCountFailed) : null, "callCountFailed" ,container.Add ); + AddIf( null != this._callCountOther ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._callCountOther) : null, "callCountOther" ,container.Add ); + AddIf( null != this._callCountTotal ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._callCountTotal) : null, "callCountTotal" ,container.Add ); + AddIf( null != this._bandwidth ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._bandwidth) : null, "bandwidth" ,container.Add ); + AddIf( null != this._cacheHitCount ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._cacheHitCount) : null, "cacheHitCount" ,container.Add ); + AddIf( null != this._cacheMissCount ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._cacheMissCount) : null, "cacheMissCount" ,container.Add ); + AddIf( null != this._apiTimeAvg ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((double)this._apiTimeAvg) : null, "apiTimeAvg" ,container.Add ); + AddIf( null != this._apiTimeMin ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((double)this._apiTimeMin) : null, "apiTimeMin" ,container.Add ); + AddIf( null != this._apiTimeMax ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((double)this._apiTimeMax) : null, "apiTimeMax" ,container.Add ); + AddIf( null != this._serviceTimeAvg ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((double)this._serviceTimeAvg) : null, "serviceTimeAvg" ,container.Add ); + AddIf( null != this._serviceTimeMin ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((double)this._serviceTimeMin) : null, "serviceTimeMin" ,container.Add ); + AddIf( null != this._serviceTimeMax ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((double)this._serviceTimeMax) : null, "serviceTimeMax" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RepresentationContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RepresentationContract.cs new file mode 100644 index 000000000000..2f2f794d47bb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RepresentationContract.cs @@ -0,0 +1,146 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation request/response representation details. + public partial class RepresentationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContractInternal + { + + /// Backing field for property. + private string _contentType; + + /// + /// Specifies a registered or custom content type for this representation, e.g. application/xml. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ContentType { get => this._contentType; set => this._contentType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract _example; + + /// Exampled defined for the representation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract Example { get => (this._example = this._example ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterExamplesContract()); set => this._example = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] _formParameter; + + /// + /// Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] FormParameter { get => this._formParameter; set => this._formParameter = value; } + + /// Backing field for property. + private string _schemaId; + + /// + /// Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SchemaId { get => this._schemaId; set => this._schemaId = value; } + + /// Backing field for property. + private string _typeName; + + /// + /// Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' + /// nor 'multipart/form-data'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TypeName { get => this._typeName; set => this._typeName = value; } + + /// Creates an new instance. + public RepresentationContract() + { + + } + } + /// Operation request/response representation details. + public partial interface IRepresentationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Specifies a registered or custom content type for this representation, e.g. application/xml. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies a registered or custom content type for this representation, e.g. application/xml.", + SerializedName = @"contentType", + PossibleTypes = new [] { typeof(string) })] + string ContentType { get; set; } + /// Exampled defined for the representation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Exampled defined for the representation.", + SerializedName = @"examples", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract Example { get; set; } + /// + /// Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..", + SerializedName = @"formParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] FormParameter { get; set; } + /// + /// Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.", + SerializedName = @"schemaId", + PossibleTypes = new [] { typeof(string) })] + string SchemaId { get; set; } + /// + /// Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' + /// nor 'multipart/form-data'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.", + SerializedName = @"typeName", + PossibleTypes = new [] { typeof(string) })] + string TypeName { get; set; } + + } + /// Operation request/response representation details. + internal partial interface IRepresentationContractInternal + + { + /// + /// Specifies a registered or custom content type for this representation, e.g. application/xml. + /// + string ContentType { get; set; } + /// Exampled defined for the representation. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterExamplesContract Example { get; set; } + /// + /// Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] FormParameter { get; set; } + /// + /// Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. + /// + string SchemaId { get; set; } + /// + /// Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' + /// nor 'multipart/form-data'. + /// + string TypeName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RepresentationContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RepresentationContract.json.cs new file mode 100644 index 000000000000..96eda6f513a2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RepresentationContract.json.cs @@ -0,0 +1,124 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation request/response representation details. + public partial class RepresentationContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RepresentationContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RepresentationContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_contentType = If( json?.PropertyT("contentType"), out var __jsonContentType) ? (string)__jsonContentType : (string)ContentType;} + {_schemaId = If( json?.PropertyT("schemaId"), out var __jsonSchemaId) ? (string)__jsonSchemaId : (string)SchemaId;} + {_typeName = If( json?.PropertyT("typeName"), out var __jsonTypeName) ? (string)__jsonTypeName : (string)TypeName;} + {_formParameter = If( json?.PropertyT("formParameters"), out var __jsonFormParameters) ? If( __jsonFormParameters as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterContract.FromJson(__u) )) ))() : null : FormParameter;} + {_example = If( json?.PropertyT("examples"), out var __jsonExamples) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterExamplesContract.FromJson(__jsonExamples) : Example;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._contentType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._contentType.ToString()) : null, "contentType" ,container.Add ); + AddIf( null != (((object)this._schemaId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._schemaId.ToString()) : null, "schemaId" ,container.Add ); + AddIf( null != (((object)this._typeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._typeName.ToString()) : null, "typeName" ,container.Add ); + if (null != this._formParameter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._formParameter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("formParameters",__w); + } + AddIf( null != this._example ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._example.ToJson(null,serializationMode) : null, "examples" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestContract.cs new file mode 100644 index 000000000000..6d182c1d2303 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestContract.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation request details. + public partial class RequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContractInternal + { + + /// Backing field for property. + private string _description; + + /// Operation request description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] _header; + + /// Collection of operation request headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] Header { get => this._header; set => this._header = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] _queryParameter; + + /// Collection of operation request query parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] QueryParameter { get => this._queryParameter; set => this._queryParameter = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] _representation; + + /// Collection of operation request representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] Representation { get => this._representation; set => this._representation = value; } + + /// Creates an new instance. + public RequestContract() + { + + } + } + /// Operation request details. + public partial interface IRequestContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Operation request description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation request description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Collection of operation request headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request headers.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] Header { get; set; } + /// Collection of operation request query parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request query parameters.", + SerializedName = @"queryParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] QueryParameter { get; set; } + /// Collection of operation request representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation request representations.", + SerializedName = @"representations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] Representation { get; set; } + + } + /// Operation request details. + internal partial interface IRequestContractInternal + + { + /// Operation request description. + string Description { get; set; } + /// Collection of operation request headers. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] Header { get; set; } + /// Collection of operation request query parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] QueryParameter { get; set; } + /// Collection of operation request representations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] Representation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestContract.json.cs new file mode 100644 index 000000000000..049ce93f0b86 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestContract.json.cs @@ -0,0 +1,138 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation request details. + public partial class RequestContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RequestContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RequestContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_queryParameter = If( json?.PropertyT("queryParameters"), out var __jsonQueryParameters) ? If( __jsonQueryParameters as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterContract.FromJson(__u) )) ))() : null : QueryParameter;} + {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? If( __jsonHeaders as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterContract.FromJson(__p) )) ))() : null : Header;} + {_representation = If( json?.PropertyT("representations"), out var __jsonRepresentations) ? If( __jsonRepresentations as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RepresentationContract.FromJson(__k) )) ))() : null : Representation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + if (null != this._queryParameter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._queryParameter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("queryParameters",__w); + } + if (null != this._header) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._header ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("headers",__r); + } + if (null != this._representation) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __n in this._representation ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("representations",__m); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportCollection.cs new file mode 100644 index 000000000000..c14c1086fd1b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportCollection.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Report records list representation. + public partial class RequestReportCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public RequestReportCollection() + { + + } + } + /// Paged Report records list representation. + public partial interface IRequestReportCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContract[] Value { get; set; } + + } + /// Paged Report records list representation. + internal partial interface IRequestReportCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportCollection.json.cs new file mode 100644 index 000000000000..5091f19dc859 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportCollection.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Report records list representation. + public partial class RequestReportCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RequestReportCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RequestReportCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RequestReportRecordContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportRecordContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportRecordContract.cs new file mode 100644 index 000000000000..06546ae9e7fc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportRecordContract.cs @@ -0,0 +1,376 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Request Report data. + public partial class RequestReportRecordContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContractInternal + { + + /// Backing field for property. + private string _apiId; + + /// API identifier path. /apis/{apiId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiId { get => this._apiId; set => this._apiId = value; } + + /// Backing field for property. + private string _apiRegion; + + /// Azure region where the gateway that processed this request is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiRegion { get => this._apiRegion; set => this._apiRegion = value; } + + /// Backing field for property. + private double? _apiTime; + + /// The total time it took to process this request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public double? ApiTime { get => this._apiTime; set => this._apiTime = value; } + + /// Backing field for property. + private string _backendResponseCode; + + /// + /// The HTTP status code received by the gateway as a result of forwarding this request to the backend. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string BackendResponseCode { get => this._backendResponseCode; set => this._backendResponseCode = value; } + + /// Backing field for property. + private string _cache; + + /// + /// Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If + /// the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss + /// and request was fulfilled by the backend. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Cache { get => this._cache; set => this._cache = value; } + + /// Backing field for property. + private string _iPAddress; + + /// The client IP address associated with this request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string IPAddress { get => this._iPAddress; set => this._iPAddress = value; } + + /// Backing field for property. + private string _method; + + /// The HTTP method associated with this request.. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Method { get => this._method; set => this._method = value; } + + /// Internal Acessors for ProductId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContractInternal.ProductId { get => this._productId; set { {_productId = value;} } } + + /// Internal Acessors for UserId + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContractInternal.UserId { get => this._userId; set { {_userId = value;} } } + + /// Backing field for property. + private string _operationId; + + /// Operation identifier path. /apis/{apiId}/operations/{operationId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// Backing field for property. + private string _productId; + + /// Product identifier path. /products/{productId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProductId { get => this._productId; } + + /// Backing field for property. + private string _requestId; + + /// Request Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string RequestId { get => this._requestId; set => this._requestId = value; } + + /// Backing field for property. + private int? _requestSize; + + /// The size of this request.. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? RequestSize { get => this._requestSize; set => this._requestSize = value; } + + /// Backing field for property. + private int? _responseCode; + + /// The HTTP status code returned by the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? ResponseCode { get => this._responseCode; set => this._responseCode = value; } + + /// Backing field for property. + private int? _responseSize; + + /// The size of the response returned by the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? ResponseSize { get => this._responseSize; set => this._responseSize = value; } + + /// Backing field for property. + private double? _serviceTime; + + /// + /// he time it took to forward this request to the backend and get the response back. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public double? ServiceTime { get => this._serviceTime; set => this._serviceTime = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Subscription identifier path. /subscriptions/{subscriptionId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private global::System.DateTime? _timestamp; + + /// + /// The date and time when this request was received by the gateway in ISO 8601 format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? Timestamp { get => this._timestamp; set => this._timestamp = value; } + + /// Backing field for property. + private string _url; + + /// The full URL associated with this request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Url { get => this._url; set => this._url = value; } + + /// Backing field for property. + private string _userId; + + /// User identifier path. /users/{userId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UserId { get => this._userId; } + + /// Creates an new instance. + public RequestReportRecordContract() + { + + } + } + /// Request Report data. + public partial interface IRequestReportRecordContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// API identifier path. /apis/{apiId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API identifier path. /apis/{apiId}", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + /// Azure region where the gateway that processed this request is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure region where the gateway that processed this request is located.", + SerializedName = @"apiRegion", + PossibleTypes = new [] { typeof(string) })] + string ApiRegion { get; set; } + /// The total time it took to process this request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total time it took to process this request.", + SerializedName = @"apiTime", + PossibleTypes = new [] { typeof(double) })] + double? ApiTime { get; set; } + /// + /// The HTTP status code received by the gateway as a result of forwarding this request to the backend. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTP status code received by the gateway as a result of forwarding this request to the backend.", + SerializedName = @"backendResponseCode", + PossibleTypes = new [] { typeof(string) })] + string BackendResponseCode { get; set; } + /// + /// Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If + /// the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss + /// and request was fulfilled by the backend. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fulfilled by the backend.", + SerializedName = @"cache", + PossibleTypes = new [] { typeof(string) })] + string Cache { get; set; } + /// The client IP address associated with this request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client IP address associated with this request.", + SerializedName = @"ipAddress", + PossibleTypes = new [] { typeof(string) })] + string IPAddress { get; set; } + /// The HTTP method associated with this request.. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTP method associated with this request..", + SerializedName = @"method", + PossibleTypes = new [] { typeof(string) })] + string Method { get; set; } + /// Operation identifier path. /apis/{apiId}/operations/{operationId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation identifier path. /apis/{apiId}/operations/{operationId}", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + /// Product identifier path. /products/{productId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Product identifier path. /products/{productId}", + SerializedName = @"productId", + PossibleTypes = new [] { typeof(string) })] + string ProductId { get; } + /// Request Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Request Identifier.", + SerializedName = @"requestId", + PossibleTypes = new [] { typeof(string) })] + string RequestId { get; set; } + /// The size of this request.. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size of this request..", + SerializedName = @"requestSize", + PossibleTypes = new [] { typeof(int) })] + int? RequestSize { get; set; } + /// The HTTP status code returned by the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTP status code returned by the gateway.", + SerializedName = @"responseCode", + PossibleTypes = new [] { typeof(int) })] + int? ResponseCode { get; set; } + /// The size of the response returned by the gateway. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size of the response returned by the gateway.", + SerializedName = @"responseSize", + PossibleTypes = new [] { typeof(int) })] + int? ResponseSize { get; set; } + /// + /// he time it took to forward this request to the backend and get the response back. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"he time it took to forward this request to the backend and get the response back.", + SerializedName = @"serviceTime", + PossibleTypes = new [] { typeof(double) })] + double? ServiceTime { get; set; } + /// Subscription identifier path. /subscriptions/{subscriptionId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription identifier path. /subscriptions/{subscriptionId}", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// + /// The date and time when this request was received by the gateway in ISO 8601 format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date and time when this request was received by the gateway in ISO 8601 format.", + SerializedName = @"timestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Timestamp { get; set; } + /// The full URL associated with this request. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full URL associated with this request.", + SerializedName = @"url", + PossibleTypes = new [] { typeof(string) })] + string Url { get; set; } + /// User identifier path. /users/{userId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"User identifier path. /users/{userId}", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; } + + } + /// Request Report data. + internal partial interface IRequestReportRecordContractInternal + + { + /// API identifier path. /apis/{apiId} + string ApiId { get; set; } + /// Azure region where the gateway that processed this request is located. + string ApiRegion { get; set; } + /// The total time it took to process this request. + double? ApiTime { get; set; } + /// + /// The HTTP status code received by the gateway as a result of forwarding this request to the backend. + /// + string BackendResponseCode { get; set; } + /// + /// Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If + /// the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss + /// and request was fulfilled by the backend. + /// + string Cache { get; set; } + /// The client IP address associated with this request. + string IPAddress { get; set; } + /// The HTTP method associated with this request.. + string Method { get; set; } + /// Operation identifier path. /apis/{apiId}/operations/{operationId} + string OperationId { get; set; } + /// Product identifier path. /products/{productId} + string ProductId { get; set; } + /// Request Identifier. + string RequestId { get; set; } + /// The size of this request.. + int? RequestSize { get; set; } + /// The HTTP status code returned by the gateway. + int? ResponseCode { get; set; } + /// The size of the response returned by the gateway. + int? ResponseSize { get; set; } + /// + /// he time it took to forward this request to the backend and get the response back. + /// + double? ServiceTime { get; set; } + /// Subscription identifier path. /subscriptions/{subscriptionId} + string SubscriptionId { get; set; } + /// + /// The date and time when this request was received by the gateway in ISO 8601 format. + /// + global::System.DateTime? Timestamp { get; set; } + /// The full URL associated with this request. + string Url { get; set; } + /// User identifier path. /users/{userId} + string UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportRecordContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportRecordContract.json.cs new file mode 100644 index 000000000000..7d0870e8e349 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/RequestReportRecordContract.json.cs @@ -0,0 +1,148 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Request Report data. + public partial class RequestReportRecordContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRequestReportRecordContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new RequestReportRecordContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal RequestReportRecordContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_apiId = If( json?.PropertyT("apiId"), out var __jsonApiId) ? (string)__jsonApiId : (string)ApiId;} + {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} + {_productId = If( json?.PropertyT("productId"), out var __jsonProductId) ? (string)__jsonProductId : (string)ProductId;} + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} + {_method = If( json?.PropertyT("method"), out var __jsonMethod) ? (string)__jsonMethod : (string)Method;} + {_url = If( json?.PropertyT("url"), out var __jsonUrl) ? (string)__jsonUrl : (string)Url;} + {_iPAddress = If( json?.PropertyT("ipAddress"), out var __jsonIPAddress) ? (string)__jsonIPAddress : (string)IPAddress;} + {_backendResponseCode = If( json?.PropertyT("backendResponseCode"), out var __jsonBackendResponseCode) ? (string)__jsonBackendResponseCode : (string)BackendResponseCode;} + {_responseCode = If( json?.PropertyT("responseCode"), out var __jsonResponseCode) ? (int?)__jsonResponseCode : ResponseCode;} + {_responseSize = If( json?.PropertyT("responseSize"), out var __jsonResponseSize) ? (int?)__jsonResponseSize : ResponseSize;} + {_timestamp = If( json?.PropertyT("timestamp"), out var __jsonTimestamp) ? global::System.DateTime.TryParse((string)__jsonTimestamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimestampValue) ? __jsonTimestampValue : Timestamp : Timestamp;} + {_cache = If( json?.PropertyT("cache"), out var __jsonCache) ? (string)__jsonCache : (string)Cache;} + {_apiTime = If( json?.PropertyT("apiTime"), out var __jsonApiTime) ? (double?)__jsonApiTime : ApiTime;} + {_serviceTime = If( json?.PropertyT("serviceTime"), out var __jsonServiceTime) ? (double?)__jsonServiceTime : ServiceTime;} + {_apiRegion = If( json?.PropertyT("apiRegion"), out var __jsonApiRegion) ? (string)__jsonApiRegion : (string)ApiRegion;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_requestId = If( json?.PropertyT("requestId"), out var __jsonRequestId) ? (string)__jsonRequestId : (string)RequestId;} + {_requestSize = If( json?.PropertyT("requestSize"), out var __jsonRequestSize) ? (int?)__jsonRequestSize : RequestSize;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._apiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiId.ToString()) : null, "apiId" ,container.Add ); + AddIf( null != (((object)this._operationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._operationId.ToString()) : null, "operationId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._productId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._productId.ToString()) : null, "productId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._userId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._userId.ToString()) : null, "userId" ,container.Add ); + } + AddIf( null != (((object)this._method)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._method.ToString()) : null, "method" ,container.Add ); + AddIf( null != (((object)this._url)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._url.ToString()) : null, "url" ,container.Add ); + AddIf( null != (((object)this._iPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._iPAddress.ToString()) : null, "ipAddress" ,container.Add ); + AddIf( null != (((object)this._backendResponseCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._backendResponseCode.ToString()) : null, "backendResponseCode" ,container.Add ); + AddIf( null != this._responseCode ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._responseCode) : null, "responseCode" ,container.Add ); + AddIf( null != this._responseSize ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._responseSize) : null, "responseSize" ,container.Add ); + AddIf( null != this._timestamp ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._timestamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "timestamp" ,container.Add ); + AddIf( null != (((object)this._cache)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._cache.ToString()) : null, "cache" ,container.Add ); + AddIf( null != this._apiTime ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((double)this._apiTime) : null, "apiTime" ,container.Add ); + AddIf( null != this._serviceTime ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((double)this._serviceTime) : null, "serviceTime" ,container.Add ); + AddIf( null != (((object)this._apiRegion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiRegion.ToString()) : null, "apiRegion" ,container.Add ); + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._requestId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._requestId.ToString()) : null, "requestId" ,container.Add ); + AddIf( null != this._requestSize ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._requestSize) : null, "requestSize" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverCollection.cs new file mode 100644 index 000000000000..b27ea8ad64f6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Resolver list representation. + public partial class ResolverCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract[] Value { get => this._value; } + + /// Creates an new instance. + public ResolverCollection() + { + + } + } + /// Paged Resolver list representation. + public partial interface IResolverCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract[] Value { get; } + + } + /// Paged Resolver list representation. + internal partial interface IResolverCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverCollection.json.cs new file mode 100644 index 000000000000..568489b2e498 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Resolver list representation. + public partial class ResolverCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResolverCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResolverCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverContract.cs new file mode 100644 index 000000000000..794912798490 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverContract.cs @@ -0,0 +1,157 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// GraphQL API Resolver details. + public partial class ResolverContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Description of the resolver. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContractInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContractInternal)Property).Description = value ?? null; } + + /// Resolver Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContractInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContractInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContract Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverEntityBaseContract()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Path is type/field being resolved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Path { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContractInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContractInternal)Property).Path = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContract _property; + + /// Properties of the Resolver Contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContract Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverEntityBaseContract()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public ResolverContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// GraphQL API Resolver details. + public partial interface IResolverContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Description of the resolver. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the resolver. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Resolver Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resolver Name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Path is type/field being resolved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Path is type/field being resolved.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + + } + /// GraphQL API Resolver details. + internal partial interface IResolverContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Description of the resolver. May include HTML formatting tags. + string Description { get; set; } + /// Resolver Name. + string DisplayName { get; set; } + + string ETag { get; set; } + /// Path is type/field being resolved. + string Path { get; set; } + /// Properties of the Resolver Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContract Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverContract.json.cs new file mode 100644 index 000000000000..f6b88bae05dc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// GraphQL API Resolver details. + public partial class ResolverContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResolverContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResolverContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverEntityBaseContract.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverEntityBaseContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverEntityBaseContract.cs new file mode 100644 index 000000000000..53ef82434aca --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverEntityBaseContract.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// GraphQL API Resolver Entity Base Contract details. + public partial class ResolverEntityBaseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContractInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the resolver. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _displayName; + + /// Resolver Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _path; + + /// Path is type/field being resolved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Path { get => this._path; set => this._path = value; } + + /// Creates an new instance. + public ResolverEntityBaseContract() + { + + } + } + /// GraphQL API Resolver Entity Base Contract details. + public partial interface IResolverEntityBaseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of the resolver. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the resolver. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Resolver Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resolver Name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Path is type/field being resolved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Path is type/field being resolved.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + + } + /// GraphQL API Resolver Entity Base Contract details. + internal partial interface IResolverEntityBaseContractInternal + + { + /// Description of the resolver. May include HTML formatting tags. + string Description { get; set; } + /// Resolver Name. + string DisplayName { get; set; } + /// Path is type/field being resolved. + string Path { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverEntityBaseContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverEntityBaseContract.json.cs new file mode 100644 index 000000000000..9e29a6a9bf85 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverEntityBaseContract.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// GraphQL API Resolver Entity Base Contract details. + public partial class ResolverEntityBaseContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverEntityBaseContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResolverEntityBaseContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResolverEntityBaseContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContract.cs new file mode 100644 index 000000000000..2cda12530192 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContract.cs @@ -0,0 +1,258 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Long Running Git Resolver Results. + public partial class ResolverResultContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// This property if only provided as part of the TenantConfiguration_Validate resolver. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy resolver. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract[] ActionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).ActionLog; } + + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Code = value ?? null; } + + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Detail = value ?? null /* arrayOf */; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Message = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for ActionLog + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractInternal.ActionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).ActionLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).ActionLog = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Error = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverResultContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Resolver result identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PropertiesId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractProperties _property; + + /// Properties of the Resolver Contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverResultContractProperties()); set => this._property = value; } + + /// Optional result info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ResultInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).ResultInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).ResultInfo = value ?? null; } + + /// + /// Start time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? Started { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Started; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Started = value ?? default(global::System.DateTime); } + + /// Status of an async resolver. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + /// Last update time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? Updated { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Updated; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal)Property).Updated = value ?? default(global::System.DateTime); } + + /// Creates an new instance. + public ResolverResultContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Long Running Git Resolver Results. + public partial interface IResolverResultContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// + /// This property if only provided as part of the TenantConfiguration_Validate resolver. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy resolver. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property if only provided as part of the TenantConfiguration_Validate resolver. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy resolver.", + SerializedName = @"actionLog", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract[] ActionLog { get; } + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of invalid fields send in request, in case of validation error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Human-readable representation of the error.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Resolver result identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resolver result identifier.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PropertiesId { get; set; } + /// Optional result info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional result info.", + SerializedName = @"resultInfo", + PossibleTypes = new [] { typeof(string) })] + string ResultInfo { get; set; } + /// + /// Start time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"started", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Started { get; set; } + /// Status of an async resolver. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of an async resolver.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus? Status { get; set; } + /// + /// Last update time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last update time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"updated", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Updated { get; set; } + + } + /// Long Running Git Resolver Results. + internal partial interface IResolverResultContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// + /// This property if only provided as part of the TenantConfiguration_Validate resolver. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy resolver. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract[] ActionLog { get; set; } + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Error Body Contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Error { get; set; } + /// Human-readable representation of the error. + string Message { get; set; } + /// Resolver result identifier. + string PropertiesId { get; set; } + /// Properties of the Resolver Contract. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractProperties Property { get; set; } + /// Optional result info. + string ResultInfo { get; set; } + /// + /// Start time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + global::System.DateTime? Started { get; set; } + /// Status of an async resolver. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus? Status { get; set; } + /// + /// Last update time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? Updated { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContract.json.cs new file mode 100644 index 000000000000..33b86a40240f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Long Running Git Resolver Results. + public partial class ResolverResultContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResolverResultContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResolverResultContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverResultContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContractProperties.cs new file mode 100644 index 000000000000..da4bf88e584a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContractProperties.cs @@ -0,0 +1,228 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resolver Result. + public partial class ResolverResultContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract[] _actionLog; + + /// + /// This property if only provided as part of the TenantConfiguration_Validate resolver. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy resolver. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract[] ActionLog { get => this._actionLog; } + + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Code = value ?? null; } + + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody _error; + + /// Error Body Contract + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponseBody()); set => this._error = value; } + + /// Backing field for property. + private string _id; + + /// Resolver result identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for ActionLog + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal.ActionLog { get => this._actionLog; set { {_actionLog = value;} } } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractPropertiesInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponseBody()); set { {_error = value;} } } + + /// Backing field for property. + private string _resultInfo; + + /// Optional result info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResultInfo { get => this._resultInfo; set => this._resultInfo = value; } + + /// Backing field for property. + private global::System.DateTime? _started; + + /// + /// Start time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? Started { get => this._started; set => this._started = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus? _status; + + /// Status of an async resolver. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus? Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private global::System.DateTime? _updated; + + /// + /// Last update time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? Updated { get => this._updated; set => this._updated = value; } + + /// Creates an new instance. + public ResolverResultContractProperties() + { + + } + } + /// Resolver Result. + public partial interface IResolverResultContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// This property if only provided as part of the TenantConfiguration_Validate resolver. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy resolver. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property if only provided as part of the TenantConfiguration_Validate resolver. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy resolver.", + SerializedName = @"actionLog", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract[] ActionLog { get; } + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of invalid fields send in request, in case of validation error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Resolver result identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resolver result identifier.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Human-readable representation of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Human-readable representation of the error.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// Optional result info. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional result info.", + SerializedName = @"resultInfo", + PossibleTypes = new [] { typeof(string) })] + string ResultInfo { get; set; } + /// + /// Start time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"started", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Started { get; set; } + /// Status of an async resolver. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of an async resolver.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus? Status { get; set; } + /// + /// Last update time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last update time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"updated", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Updated { get; set; } + + } + /// Resolver Result. + internal partial interface IResolverResultContractPropertiesInternal + + { + /// + /// This property if only provided as part of the TenantConfiguration_Validate resolver. It contains the log the entities + /// which will be updated/created/deleted as part of the TenantConfiguration_Deploy resolver. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract[] ActionLog { get; set; } + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorFieldContract[] Detail { get; set; } + /// Error Body Contract + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IErrorResponseBody Error { get; set; } + /// Resolver result identifier. + string Id { get; set; } + /// Human-readable representation of the error. + string Message { get; set; } + /// Optional result info. + string ResultInfo { get; set; } + /// + /// Start time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the + /// ISO 8601 standard. + /// + global::System.DateTime? Started { get; set; } + /// Status of an async resolver. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus? Status { get; set; } + /// + /// Last update time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? Updated { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContractProperties.json.cs new file mode 100644 index 000000000000..ed6c21de91f8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultContractProperties.json.cs @@ -0,0 +1,131 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resolver Result. + public partial class ResolverResultContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResolverResultContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResolverResultContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ErrorResponseBody.FromJson(__jsonError) : Error;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_started = If( json?.PropertyT("started"), out var __jsonStarted) ? global::System.DateTime.TryParse((string)__jsonStarted, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedValue) ? __jsonStartedValue : Started : Started;} + {_updated = If( json?.PropertyT("updated"), out var __jsonUpdated) ? global::System.DateTime.TryParse((string)__jsonUpdated, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedValue) ? __jsonUpdatedValue : Updated : Updated;} + {_resultInfo = If( json?.PropertyT("resultInfo"), out var __jsonResultInfo) ? (string)__jsonResultInfo : (string)ResultInfo;} + {_actionLog = If( json?.PropertyT("actionLog"), out var __jsonActionLog) ? If( __jsonActionLog as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverResultLogItemContract.FromJson(__u) )) ))() : null : ActionLog;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._started ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._started?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "started" ,container.Add ); + AddIf( null != this._updated ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._updated?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "updated" ,container.Add ); + AddIf( null != (((object)this._resultInfo)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resultInfo.ToString()) : null, "resultInfo" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._actionLog) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._actionLog ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("actionLog",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultLogItemContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultLogItemContract.cs new file mode 100644 index 000000000000..4f00c4601cdb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultLogItemContract.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Log of the entity being created, updated or deleted. + public partial class ResolverResultLogItemContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContractInternal + { + + /// Backing field for property. + private string _action; + + /// Action like create/update/delete. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Action { get => this._action; set => this._action = value; } + + /// Backing field for property. + private string _objectKey; + + /// Identifier of the entity being created/updated/deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ObjectKey { get => this._objectKey; set => this._objectKey = value; } + + /// Backing field for property. + private string _objectType; + + /// The type of entity contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Creates an new instance. + public ResolverResultLogItemContract() + { + + } + } + /// Log of the entity being created, updated or deleted. + public partial interface IResolverResultLogItemContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Action like create/update/delete. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Action like create/update/delete.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(string) })] + string Action { get; set; } + /// Identifier of the entity being created/updated/deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the entity being created/updated/deleted.", + SerializedName = @"objectKey", + PossibleTypes = new [] { typeof(string) })] + string ObjectKey { get; set; } + /// The type of entity contract. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of entity contract.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(string) })] + string ObjectType { get; set; } + + } + /// Log of the entity being created, updated or deleted. + internal partial interface IResolverResultLogItemContractInternal + + { + /// Action like create/update/delete. + string Action { get; set; } + /// Identifier of the entity being created/updated/deleted. + string ObjectKey { get; set; } + /// The type of entity contract. + string ObjectType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultLogItemContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultLogItemContract.json.cs new file mode 100644 index 000000000000..e4efdaec52b0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverResultLogItemContract.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Log of the entity being created, updated or deleted. + public partial class ResolverResultLogItemContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverResultLogItemContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResolverResultLogItemContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResolverResultLogItemContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} + {_objectKey = If( json?.PropertyT("objectKey"), out var __jsonObjectKey) ? (string)__jsonObjectKey : (string)ObjectKey;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + AddIf( null != (((object)this._action)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._action.ToString()) : null, "action" ,container.Add ); + AddIf( null != (((object)this._objectKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._objectKey.ToString()) : null, "objectKey" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContract.cs new file mode 100644 index 000000000000..7a70ccb696c1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContract.cs @@ -0,0 +1,88 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// GraphQL API Resolver Update Contract details. + public partial class ResolverUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractInternal + { + + /// Description of the resolver. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractPropertiesInternal)Property).Description = value ?? null; } + + /// Resolver Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverUpdateContractProperties()); set { {_property = value;} } } + + /// Path is type/field being resolved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Path { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractPropertiesInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractPropertiesInternal)Property).Path = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractProperties _property; + + /// Properties of the GraphQL API Resolver entity that can be updated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverUpdateContractProperties()); set => this._property = value; } + + /// Creates an new instance. + public ResolverUpdateContract() + { + + } + } + /// GraphQL API Resolver Update Contract details. + public partial interface IResolverUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of the resolver. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the resolver. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Resolver Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resolver Name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Path is type/field being resolved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Path is type/field being resolved.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + + } + /// GraphQL API Resolver Update Contract details. + internal partial interface IResolverUpdateContractInternal + + { + /// Description of the resolver. May include HTML formatting tags. + string Description { get; set; } + /// Resolver Name. + string DisplayName { get; set; } + /// Path is type/field being resolved. + string Path { get; set; } + /// Properties of the GraphQL API Resolver entity that can be updated. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContract.json.cs new file mode 100644 index 000000000000..d2fb8bc14d61 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// GraphQL API Resolver Update Contract details. + public partial class ResolverUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResolverUpdateContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResolverUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResolverUpdateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContractProperties.cs new file mode 100644 index 000000000000..046b5cc1a2dd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContractProperties.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resolver Update Contract Properties. + public partial class ResolverUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the resolver. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _displayName; + + /// Resolver Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _path; + + /// Path is type/field being resolved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Path { get => this._path; set => this._path = value; } + + /// Creates an new instance. + public ResolverUpdateContractProperties() + { + + } + } + /// Resolver Update Contract Properties. + public partial interface IResolverUpdateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of the resolver. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the resolver. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Resolver Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resolver Name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Path is type/field being resolved. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Path is type/field being resolved.", + SerializedName = @"path", + PossibleTypes = new [] { typeof(string) })] + string Path { get; set; } + + } + /// Resolver Update Contract Properties. + internal partial interface IResolverUpdateContractPropertiesInternal + + { + /// Description of the resolver. May include HTML formatting tags. + string Description { get; set; } + /// Resolver Name. + string DisplayName { get; set; } + /// Path is type/field being resolved. + string Path { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContractProperties.json.cs new file mode 100644 index 000000000000..5b5291ef6c1b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResolverUpdateContractProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resolver Update Contract Properties. + public partial class ResolverUpdateContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResolverUpdateContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResolverUpdateContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResolverUpdateContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollection.cs new file mode 100644 index 000000000000..7d7514ea311d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A collection of resources. + public partial class ResourceCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource[] _value; + + /// A collection of resources. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ResourceCollection() + { + + } + } + /// A collection of resources. + public partial interface IResourceCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// A collection of resources. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A collection of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource[] Value { get; set; } + + } + /// A collection of resources. + internal partial interface IResourceCollectionInternal + + { + /// Total record count number. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// A collection of resources. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollection.json.cs new file mode 100644 index 000000000000..f008fd0ec28f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// A collection of resources. + public partial class ResourceCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResourceCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollectionValueItem.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollectionValueItem.cs new file mode 100644 index 000000000000..6906598c1d9a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollectionValueItem.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ResourceCollectionValueItem : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceCollectionValueItem, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceCollectionValueItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ResourceCollectionValueItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + public partial interface IResourceCollectionValueItem : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + + } + internal partial interface IResourceCollectionValueItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollectionValueItem.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollectionValueItem.json.cs new file mode 100644 index 000000000000..952a5f747ed6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceCollectionValueItem.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ResourceCollectionValueItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceCollectionValueItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceCollectionValueItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceCollectionValueItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResourceCollectionValueItem(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceCollectionValueItem(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceLocationDataContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceLocationDataContract.cs new file mode 100644 index 000000000000..7864a12feb4f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceLocationDataContract.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resource location data properties. + public partial class ResourceLocationDataContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContractInternal + { + + /// Backing field for property. + private string _city; + + /// The city or locality where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string City { get => this._city; set => this._city = value; } + + /// Backing field for property. + private string _countryOrRegion; + + /// The country or region where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string CountryOrRegion { get => this._countryOrRegion; set => this._countryOrRegion = value; } + + /// Backing field for property. + private string _district; + + /// The district, state, or province where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string District { get => this._district; set => this._district = value; } + + /// Backing field for property. + private string _name; + + /// A canonical name for the geographic or physical location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public ResourceLocationDataContract() + { + + } + } + /// Resource location data properties. + public partial interface IResourceLocationDataContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The city or locality where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The city or locality where the resource is located.", + SerializedName = @"city", + PossibleTypes = new [] { typeof(string) })] + string City { get; set; } + /// The country or region where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The country or region where the resource is located.", + SerializedName = @"countryOrRegion", + PossibleTypes = new [] { typeof(string) })] + string CountryOrRegion { get; set; } + /// The district, state, or province where the resource is located. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The district, state, or province where the resource is located.", + SerializedName = @"district", + PossibleTypes = new [] { typeof(string) })] + string District { get; set; } + /// A canonical name for the geographic or physical location. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A canonical name for the geographic or physical location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Resource location data properties. + internal partial interface IResourceLocationDataContractInternal + + { + /// The city or locality where the resource is located. + string City { get; set; } + /// The country or region where the resource is located. + string CountryOrRegion { get; set; } + /// The district, state, or province where the resource is located. + string District { get; set; } + /// A canonical name for the geographic or physical location. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceLocationDataContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceLocationDataContract.json.cs new file mode 100644 index 000000000000..1c07fca557a2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceLocationDataContract.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Resource location data properties. + public partial class ResourceLocationDataContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceLocationDataContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResourceLocationDataContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceLocationDataContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)City;} + {_district = If( json?.PropertyT("district"), out var __jsonDistrict) ? (string)__jsonDistrict : (string)District;} + {_countryOrRegion = If( json?.PropertyT("countryOrRegion"), out var __jsonCountryOrRegion) ? (string)__jsonCountryOrRegion : (string)CountryOrRegion;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._city)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._city.ToString()) : null, "city" ,container.Add ); + AddIf( null != (((object)this._district)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._district.ToString()) : null, "district" ,container.Add ); + AddIf( null != (((object)this._countryOrRegion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._countryOrRegion.ToString()) : null, "countryOrRegion" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSku.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSku.cs new file mode 100644 index 000000000000..b4ff6dc04076 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSku.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes an available API Management SKU. + public partial class ResourceSku : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSku, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType? _name; + + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType? Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public ResourceSku() + { + + } + } + /// Describes an available API Management SKU. + public partial interface IResourceSku : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the Sku.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType? Name { get; set; } + + } + /// Describes an available API Management SKU. + internal partial interface IResourceSkuInternal + + { + /// Name of the Sku. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType? Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSku.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSku.json.cs new file mode 100644 index 000000000000..0a053cae5917 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSku.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes an available API Management SKU. + public partial class ResourceSku + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResourceSku(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSku(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuCapacity.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuCapacity.cs new file mode 100644 index 000000000000..86dfe7ef6f2c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuCapacity.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes scaling information of a SKU. + public partial class ResourceSkuCapacity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacity, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal + { + + /// Backing field for property. + private int? _default; + + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? Default { get => this._default; } + + /// Backing field for property. + private int? _maximum; + + /// The maximum capacity that can be set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? Maximum { get => this._maximum; } + + /// Internal Acessors for Default + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal.Default { get => this._default; set { {_default = value;} } } + + /// Internal Acessors for Maximum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal.Maximum { get => this._maximum; set { {_maximum = value;} } } + + /// Internal Acessors for Minimum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal.Minimum { get => this._minimum; set { {_minimum = value;} } } + + /// Internal Acessors for ScaleType + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal.ScaleType { get => this._scaleType; set { {_scaleType = value;} } } + + /// Backing field for property. + private int? _minimum; + + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int? Minimum { get => this._minimum; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType? _scaleType; + + /// The scale type applicable to the sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType? ScaleType { get => this._scaleType; } + + /// Creates an new instance. + public ResourceSkuCapacity() + { + + } + } + /// Describes scaling information of a SKU. + public partial interface IResourceSkuCapacity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The default capacity.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(int) })] + int? Default { get; } + /// The maximum capacity that can be set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The maximum capacity that can be set.", + SerializedName = @"maximum", + PossibleTypes = new [] { typeof(int) })] + int? Maximum { get; } + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The minimum capacity.", + SerializedName = @"minimum", + PossibleTypes = new [] { typeof(int) })] + int? Minimum { get; } + /// The scale type applicable to the sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The scale type applicable to the sku.", + SerializedName = @"scaleType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType? ScaleType { get; } + + } + /// Describes scaling information of a SKU. + internal partial interface IResourceSkuCapacityInternal + + { + /// The default capacity. + int? Default { get; set; } + /// The maximum capacity that can be set. + int? Maximum { get; set; } + /// The minimum capacity. + int? Minimum { get; set; } + /// The scale type applicable to the sku. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType? ScaleType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuCapacity.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuCapacity.json.cs new file mode 100644 index 000000000000..e1c2cd78e224 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuCapacity.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes scaling information of a SKU. + public partial class ResourceSkuCapacity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResourceSkuCapacity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSkuCapacity(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_minimum = If( json?.PropertyT("minimum"), out var __jsonMinimum) ? (int?)__jsonMinimum : Minimum;} + {_maximum = If( json?.PropertyT("maximum"), out var __jsonMaximum) ? (int?)__jsonMaximum : Maximum;} + {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (int?)__jsonDefault : Default;} + {_scaleType = If( json?.PropertyT("scaleType"), out var __jsonScaleType) ? (string)__jsonScaleType : (string)ScaleType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._minimum ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._minimum) : null, "minimum" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._maximum ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._maximum) : null, "maximum" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._default ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((int)this._default) : null, "default" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._scaleType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._scaleType.ToString()) : null, "scaleType" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResult.cs new file mode 100644 index 000000000000..3b6023186434 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResult.cs @@ -0,0 +1,160 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes an available API Management service SKU. + public partial class ResourceSkuResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacity _capacity; + + /// Specifies the number of API Management units. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacity Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceSkuCapacity()); } + + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).Default; } + + /// The maximum capacity that can be set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).Maximum; } + + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).Minimum; } + + /// The scale type applicable to the sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType? CapacityScaleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).ScaleType; } + + /// Internal Acessors for Capacity + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacity Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResultInternal.Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceSkuCapacity()); set { {_capacity = value;} } } + + /// Internal Acessors for CapacityDefault + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResultInternal.CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).Default; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).Default = value; } + + /// Internal Acessors for CapacityMaximum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResultInternal.CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).Maximum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).Maximum = value; } + + /// Internal Acessors for CapacityMinimum + int? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResultInternal.CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).Minimum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).Minimum = value; } + + /// Internal Acessors for CapacityScaleType + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResultInternal.CapacityScaleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).ScaleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacityInternal)Capacity).ScaleType = value; } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResultInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSku Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResultInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceSku()); set { {_sku = value;} } } + + /// Backing field for property. + private string _resourceType; + + /// The type of resource the SKU applies to. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceType { get => this._resourceType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSku _sku; + + /// Specifies API Management SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceSku()); } + + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType)""); } + + /// Creates an new instance. + public ResourceSkuResult() + { + + } + } + /// Describes an available API Management service SKU. + public partial interface IResourceSkuResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The default capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The default capacity.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(int) })] + int? CapacityDefault { get; } + /// The maximum capacity that can be set. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The maximum capacity that can be set.", + SerializedName = @"maximum", + PossibleTypes = new [] { typeof(int) })] + int? CapacityMaximum { get; } + /// The minimum capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The minimum capacity.", + SerializedName = @"minimum", + PossibleTypes = new [] { typeof(int) })] + int? CapacityMinimum { get; } + /// The scale type applicable to the sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The scale type applicable to the sku.", + SerializedName = @"scaleType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType? CapacityScaleType { get; } + /// The type of resource the SKU applies to. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of resource the SKU applies to.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// Name of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the Sku.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType? SkuName { get; set; } + + } + /// Describes an available API Management service SKU. + internal partial interface IResourceSkuResultInternal + + { + /// Specifies the number of API Management units. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuCapacity Capacity { get; set; } + /// The default capacity. + int? CapacityDefault { get; set; } + /// The maximum capacity that can be set. + int? CapacityMaximum { get; set; } + /// The minimum capacity. + int? CapacityMinimum { get; set; } + /// The scale type applicable to the sku. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType? CapacityScaleType { get; set; } + /// The type of resource the SKU applies to. + string ResourceType { get; set; } + /// Specifies API Management SKU. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSku Sku { get; set; } + /// Name of the Sku. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType? SkuName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResult.json.cs new file mode 100644 index 000000000000..3ec8e92369ae --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResult.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Describes an available API Management service SKU. + public partial class ResourceSkuResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResourceSkuResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSkuResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceSku.FromJson(__jsonSku) : Sku;} + {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceSkuCapacity.FromJson(__jsonCapacity) : Capacity;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._capacity ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._capacity.ToJson(null,serializationMode) : null, "capacity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResults.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResults.cs new file mode 100644 index 000000000000..7068009177ea --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResults.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The API Management service SKUs operation response. + public partial class ResourceSkuResults : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResults, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResultsInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The uri to fetch the next page of API Management service Skus. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResult[] _value; + + /// The list of skus available for the service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResult[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ResourceSkuResults() + { + + } + } + /// The API Management service SKUs operation response. + public partial interface IResourceSkuResults : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The uri to fetch the next page of API Management service Skus. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The uri to fetch the next page of API Management service Skus.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of skus available for the service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of skus available for the service.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResult) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResult[] Value { get; set; } + + } + /// The API Management service SKUs operation response. + internal partial interface IResourceSkuResultsInternal + + { + /// The uri to fetch the next page of API Management service Skus. + string NextLink { get; set; } + /// The list of skus available for the service. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResult[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResults.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResults.json.cs new file mode 100644 index 000000000000..7c42ebd1ef29 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResourceSkuResults.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The API Management service SKUs operation response. + public partial class ResourceSkuResults + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResults. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResults. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResults FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResourceSkuResults(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceSkuResults(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResourceSkuResult) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ResourceSkuResult.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResponseContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResponseContract.cs new file mode 100644 index 000000000000..9998864a88aa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResponseContract.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation response details. + public partial class ResponseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContractInternal + { + + /// Backing field for property. + private string _description; + + /// Operation response description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] _header; + + /// Collection of operation response headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] Header { get => this._header; set => this._header = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] _representation; + + /// Collection of operation response representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] Representation { get => this._representation; set => this._representation = value; } + + /// Backing field for property. + private int _statusCode; + + /// Operation response HTTP status code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public int StatusCode { get => this._statusCode; set => this._statusCode = value; } + + /// Creates an new instance. + public ResponseContract() + { + + } + } + /// Operation response details. + public partial interface IResponseContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Operation response description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation response description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Collection of operation response headers. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation response headers.", + SerializedName = @"headers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] Header { get; set; } + /// Collection of operation response representations. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of operation response representations.", + SerializedName = @"representations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] Representation { get; set; } + /// Operation response HTTP status code. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Operation response HTTP status code.", + SerializedName = @"statusCode", + PossibleTypes = new [] { typeof(int) })] + int StatusCode { get; set; } + + } + /// Operation response details. + internal partial interface IResponseContractInternal + + { + /// Operation response description. + string Description { get; set; } + /// Collection of operation response headers. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract[] Header { get; set; } + /// Collection of operation response representations. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract[] Representation { get; set; } + /// Operation response HTTP status code. + int StatusCode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResponseContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResponseContract.json.cs new file mode 100644 index 000000000000..1d20070b300c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/ResponseContract.json.cs @@ -0,0 +1,130 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Operation response details. + public partial class ResponseContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IResponseContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ResponseContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ResponseContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_statusCode = If( json?.PropertyT("statusCode"), out var __jsonStatusCode) ? (int)__jsonStatusCode : StatusCode;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_representation = If( json?.PropertyT("representations"), out var __jsonRepresentations) ? If( __jsonRepresentations as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IRepresentationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.RepresentationContract.FromJson(__u) )) ))() : null : Representation;} + {_header = If( json?.PropertyT("headers"), out var __jsonHeaders) ? If( __jsonHeaders as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IParameterContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ParameterContract.FromJson(__p) )) ))() : null : Header;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber(this._statusCode), "statusCode" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + if (null != this._representation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._representation ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("representations",__w); + } + if (null != this._header) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __s in this._header ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("headers",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SamplingSettings.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SamplingSettings.cs new file mode 100644 index 000000000000..14f644435bbf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SamplingSettings.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sampling settings for Diagnostic. + public partial class SamplingSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettingsInternal + { + + /// Backing field for property. + private double? _percentage; + + /// Rate of sampling for fixed-rate sampling. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public double? Percentage { get => this._percentage; set => this._percentage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType? _samplingType; + + /// Sampling type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType? SamplingType { get => this._samplingType; set => this._samplingType = value; } + + /// Creates an new instance. + public SamplingSettings() + { + + } + } + /// Sampling settings for Diagnostic. + public partial interface ISamplingSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Rate of sampling for fixed-rate sampling. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rate of sampling for fixed-rate sampling.", + SerializedName = @"percentage", + PossibleTypes = new [] { typeof(double) })] + double? Percentage { get; set; } + /// Sampling type. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sampling type.", + SerializedName = @"samplingType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType? SamplingType { get; set; } + + } + /// Sampling settings for Diagnostic. + internal partial interface ISamplingSettingsInternal + + { + /// Rate of sampling for fixed-rate sampling. + double? Percentage { get; set; } + /// Sampling type. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType? SamplingType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SamplingSettings.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SamplingSettings.json.cs new file mode 100644 index 000000000000..e0f446086745 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SamplingSettings.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Sampling settings for Diagnostic. + public partial class SamplingSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISamplingSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SamplingSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SamplingSettings(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_samplingType = If( json?.PropertyT("samplingType"), out var __jsonSamplingType) ? (string)__jsonSamplingType : (string)SamplingType;} + {_percentage = If( json?.PropertyT("percentage"), out var __jsonPercentage) ? (double?)__jsonPercentage : Percentage;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._samplingType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._samplingType.ToString()) : null, "samplingType" ,container.Add ); + AddIf( null != this._percentage ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((double)this._percentage) : null, "percentage" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameter.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameter.cs new file mode 100644 index 000000000000..d09f16a33919 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameter.cs @@ -0,0 +1,89 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Save Tenant Configuration Contract details. + public partial class SaveConfigurationParameter : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameter, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterInternal + { + + /// + /// The name of the Git branch in which to commit the current configuration snapshot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Branch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterPropertiesInternal)Property).Branch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterPropertiesInternal)Property).Branch = value ?? null; } + + /// + /// The value if true, the current configuration database is committed to the Git repository, even if the Git repository has + /// newer changes that would be overwritten. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? Force { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterPropertiesInternal)Property).Force; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterPropertiesInternal)Property).Force = value ?? default(bool); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SaveConfigurationParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterProperties _property; + + /// Properties of the Save Configuration Parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SaveConfigurationParameterProperties()); set => this._property = value; } + + /// Creates an new instance. + public SaveConfigurationParameter() + { + + } + } + /// Save Tenant Configuration Contract details. + public partial interface ISaveConfigurationParameter : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The name of the Git branch in which to commit the current configuration snapshot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Git branch in which to commit the current configuration snapshot.", + SerializedName = @"branch", + PossibleTypes = new [] { typeof(string) })] + string Branch { get; set; } + /// + /// The value if true, the current configuration database is committed to the Git repository, even if the Git repository has + /// newer changes that would be overwritten. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value if true, the current configuration database is committed to the Git repository, even if the Git repository has newer changes that would be overwritten.", + SerializedName = @"force", + PossibleTypes = new [] { typeof(bool) })] + bool? Force { get; set; } + + } + /// Save Tenant Configuration Contract details. + internal partial interface ISaveConfigurationParameterInternal + + { + /// + /// The name of the Git branch in which to commit the current configuration snapshot. + /// + string Branch { get; set; } + /// + /// The value if true, the current configuration database is committed to the Git repository, even if the Git repository has + /// newer changes that would be overwritten. + /// + bool? Force { get; set; } + /// Properties of the Save Configuration Parameters. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameter.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameter.json.cs new file mode 100644 index 000000000000..6e1718be1d5e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameter.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Save Tenant Configuration Contract details. + public partial class SaveConfigurationParameter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SaveConfigurationParameter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SaveConfigurationParameter(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SaveConfigurationParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameterProperties.cs new file mode 100644 index 000000000000..009dfddede82 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameterProperties.cs @@ -0,0 +1,83 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Save Tenant Configuration operation. + public partial class SaveConfigurationParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterPropertiesInternal + { + + /// Backing field for property. + private string _branch; + + /// + /// The name of the Git branch in which to commit the current configuration snapshot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Branch { get => this._branch; set => this._branch = value; } + + /// Backing field for property. + private bool? _force; + + /// + /// The value if true, the current configuration database is committed to the Git repository, even if the Git repository has + /// newer changes that would be overwritten. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Force { get => this._force; set => this._force = value; } + + /// Creates an new instance. + public SaveConfigurationParameterProperties() + { + + } + } + /// Parameters supplied to the Save Tenant Configuration operation. + public partial interface ISaveConfigurationParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The name of the Git branch in which to commit the current configuration snapshot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Git branch in which to commit the current configuration snapshot.", + SerializedName = @"branch", + PossibleTypes = new [] { typeof(string) })] + string Branch { get; set; } + /// + /// The value if true, the current configuration database is committed to the Git repository, even if the Git repository has + /// newer changes that would be overwritten. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value if true, the current configuration database is committed to the Git repository, even if the Git repository has newer changes that would be overwritten.", + SerializedName = @"force", + PossibleTypes = new [] { typeof(bool) })] + bool? Force { get; set; } + + } + /// Parameters supplied to the Save Tenant Configuration operation. + internal partial interface ISaveConfigurationParameterPropertiesInternal + + { + /// + /// The name of the Git branch in which to commit the current configuration snapshot. + /// + string Branch { get; set; } + /// + /// The value if true, the current configuration database is committed to the Git repository, even if the Git repository has + /// newer changes that would be overwritten. + /// + bool? Force { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameterProperties.json.cs new file mode 100644 index 000000000000..2f206d634a8a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SaveConfigurationParameterProperties.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Save Tenant Configuration operation. + public partial class SaveConfigurationParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISaveConfigurationParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SaveConfigurationParameterProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SaveConfigurationParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_branch = If( json?.PropertyT("branch"), out var __jsonBranch) ? (string)__jsonBranch : (string)Branch;} + {_force = If( json?.PropertyT("force"), out var __jsonForce) ? (bool?)__jsonForce : Force;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._branch)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._branch.ToString()) : null, "branch" ,container.Add ); + AddIf( null != this._force ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._force) : null, "force" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaCollection.cs new file mode 100644 index 000000000000..1c968794670a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaCollection.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the list schema operation. + public partial class SchemaCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract[] _value; + + /// API Schema Contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract[] Value { get => this._value; } + + /// Creates an new instance. + public SchemaCollection() + { + + } + } + /// The response of the list schema operation. + public partial interface ISchemaCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// API Schema Contract value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"API Schema Contract value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract[] Value { get; } + + } + /// The response of the list schema operation. + internal partial interface ISchemaCollectionInternal + + { + /// Total record count number. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// API Schema Contract value. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaCollection.json.cs new file mode 100644 index 000000000000..effab60b37bc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaCollection.json.cs @@ -0,0 +1,126 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// The response of the list schema operation. + public partial class SchemaCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SchemaCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SchemaCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContract.cs new file mode 100644 index 000000000000..51b9c8073a13 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContract.cs @@ -0,0 +1,255 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Schema Contract details. + public partial class SchemaContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// + /// Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document + /// (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` + ///
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json` + ///
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`
- `OData Schema` use `application/vnd.ms-azure-apim.odata.schema` + ///
- `gRPC Schema` use `text/protobuf`. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ContentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).ContentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).ContentType = value ?? null; } + + /// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentComponent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).DocumentComponent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).DocumentComponent = value ?? null /* model class */; } + + /// Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).DocumentDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).DocumentDefinition = value ?? null /* model class */; } + + /// + /// Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DocumentValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).DocumentValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).DocumentValue = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Document + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractInternal.Document { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).Document; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).Document = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaContractProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).ProvisioningState = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractProperties _property; + + /// Properties of the API Schema. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaContractProperties()); set => this._property = value; } + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal)Property).ProvisioningState; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + if (headers.TryGetValues("location", out var __locationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader1) is string __headerLocationHeader1 ? __headerLocationHeader1 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader2)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader2) is string __headerAzureAsyncOperationHeader2 ? __headerAzureAsyncOperationHeader2 : (string)null; + } + } + + /// Creates an new instance. + public SchemaContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// API Schema Contract details. + public partial interface ISchemaContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + /// + /// Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document + /// (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` + ///
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json` + ///
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`
- `OData Schema` use `application/vnd.ms-azure-apim.odata.schema` + ///
- `gRPC Schema` use `text/protobuf`. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json`
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`
- `OData Schema` use `application/vnd.ms-azure-apim.odata.schema`
- `gRPC Schema` use `text/protobuf`.", + SerializedName = @"contentType", + PossibleTypes = new [] { typeof(string) })] + string ContentType { get; set; } + /// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise.", + SerializedName = @"components", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentComponent { get; set; } + /// Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise.", + SerializedName = @"definitions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentDefinition { get; set; } + /// + /// Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string DocumentValue { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + + } + /// API Schema Contract details. + internal partial interface ISchemaContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string AzureAsyncOperation { get; set; } + /// + /// Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document + /// (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` + ///
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json` + ///
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`
- `OData Schema` use `application/vnd.ms-azure-apim.odata.schema` + ///
- `gRPC Schema` use `text/protobuf`. + ///
+ string ContentType { get; set; } + /// Create or update Properties of the API Schema Document. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentProperties Document { get; set; } + /// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentComponent { get; set; } + /// Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentDefinition { get; set; } + /// + /// Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. + /// + string DocumentValue { get; set; } + + string ETag { get; set; } + + string Location { get; set; } + /// Properties of the API Schema. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractProperties Property { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContract.json.cs new file mode 100644 index 000000000000..7c8865bd8201 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Schema Contract details. + public partial class SchemaContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SchemaContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SchemaContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContractProperties.cs new file mode 100644 index 000000000000..7b34f884f8d5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContractProperties.cs @@ -0,0 +1,149 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Schema create or update contract Properties. + public partial class SchemaContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal + { + + /// Backing field for property. + private string _contentType; + + /// + /// Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document + /// (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` + ///
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json` + ///
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`
- `OData Schema` use `application/vnd.ms-azure-apim.odata.schema` + ///
- `gRPC Schema` use `text/protobuf`. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ContentType { get => this._contentType; set => this._contentType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentProperties _document; + + /// Create or update Properties of the API Schema Document. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentProperties Document { get => (this._document = this._document ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaDocumentProperties()); set => this._document = value; } + + /// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentComponent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentPropertiesInternal)Document).Component; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentPropertiesInternal)Document).Component = value ?? null /* model class */; } + + /// Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentPropertiesInternal)Document).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentPropertiesInternal)Document).Definition = value ?? null /* model class */; } + + /// + /// Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DocumentValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentPropertiesInternal)Document).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentPropertiesInternal)Document).Value = value ?? null; } + + /// Internal Acessors for Document + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal.Document { get => (this._document = this._document ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaDocumentProperties()); set { {_document = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Creates an new instance. + public SchemaContractProperties() + { + + } + } + /// API Schema create or update contract Properties. + public partial interface ISchemaContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document + /// (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` + ///
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json` + ///
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`
- `OData Schema` use `application/vnd.ms-azure-apim.odata.schema` + ///
- `gRPC Schema` use `text/protobuf`. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json`
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`
- `OData Schema` use `application/vnd.ms-azure-apim.odata.schema`
- `gRPC Schema` use `text/protobuf`.", + SerializedName = @"contentType", + PossibleTypes = new [] { typeof(string) })] + string ContentType { get; set; } + /// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise.", + SerializedName = @"components", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentComponent { get; set; } + /// Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise.", + SerializedName = @"definitions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentDefinition { get; set; } + /// + /// Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string DocumentValue { get; set; } + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + + } + /// API Schema create or update contract Properties. + internal partial interface ISchemaContractPropertiesInternal + + { + /// + /// Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document + /// (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` + ///
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json` + ///
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`
- `OData Schema` use `application/vnd.ms-azure-apim.odata.schema` + ///
- `gRPC Schema` use `text/protobuf`. + ///
+ string ContentType { get; set; } + /// Create or update Properties of the API Schema Document. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentProperties Document { get; set; } + /// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentComponent { get; set; } + /// Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny DocumentDefinition { get; set; } + /// + /// Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. + /// + string DocumentValue { get; set; } + /// The provisioning state + string ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContractProperties.json.cs new file mode 100644 index 000000000000..6d4c624b0826 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaContractProperties.json.cs @@ -0,0 +1,115 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// API Schema create or update contract Properties. + public partial class SchemaContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SchemaContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SchemaContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_document = If( json?.PropertyT("document"), out var __jsonDocument) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SchemaDocumentProperties.FromJson(__jsonDocument) : Document;} + {_contentType = If( json?.PropertyT("contentType"), out var __jsonContentType) ? (string)__jsonContentType : (string)ContentType;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._document ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._document.ToJson(null,serializationMode) : null, "document" ,container.Add ); + AddIf( null != (((object)this._contentType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._contentType.ToString()) : null, "contentType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaDocumentProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaDocumentProperties.cs new file mode 100644 index 000000000000..b6c294467914 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaDocumentProperties.cs @@ -0,0 +1,91 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Api Schema Document Properties. + public partial class SchemaDocumentProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny _component; + + /// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Component { get => (this._component = this._component ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any()); set => this._component = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny _definition; + + /// Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any()); set => this._definition = value; } + + /// Backing field for property. + private string _value; + + /// + /// Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public SchemaDocumentProperties() + { + + } + } + /// Api Schema Document Properties. + public partial interface ISchemaDocumentProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise.", + SerializedName = @"components", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Component { get; set; } + /// Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise.", + SerializedName = @"definitions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Definition { get; set; } + /// + /// Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Api Schema Document Properties. + internal partial interface ISchemaDocumentPropertiesInternal + + { + /// Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Component { get; set; } + /// Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAny Definition { get; set; } + /// + /// Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. + /// + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaDocumentProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaDocumentProperties.json.cs new file mode 100644 index 000000000000..d2d0e84cf50f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SchemaDocumentProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Api Schema Document Properties. + public partial class SchemaDocumentProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISchemaDocumentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SchemaDocumentProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SchemaDocumentProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_definition = If( json?.PropertyT("definitions"), out var __jsonDefinitions) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any.FromJson(__jsonDefinitions) : Definition;} + {_component = If( json?.PropertyT("components"), out var __jsonComponents) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Any.FromJson(__jsonComponents) : Component;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != this._definition ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._definition.ToJson(null,serializationMode) : null, "definitions" ,container.Add ); + AddIf( null != this._component ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._component.ToJson(null,serializationMode) : null, "components" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCollection.cs new file mode 100644 index 000000000000..17191b26fa5e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Subscriptions list representation. + public partial class SubscriptionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public SubscriptionCollection() + { + + } + } + /// Paged Subscriptions list representation. + public partial interface ISubscriptionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContract[] Value { get; set; } + + } + /// Paged Subscriptions list representation. + internal partial interface ISubscriptionCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCollection.json.cs new file mode 100644 index 000000000000..1c12f1c64acd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Subscriptions list representation. + public partial class SubscriptionCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContract.cs new file mode 100644 index 000000000000..d9aef0dedf91 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContract.cs @@ -0,0 +1,410 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription details. + public partial class SubscriptionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Determines whether tracing is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? AllowTracing { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).AllowTracing; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).AllowTracing = value ?? default(bool); } + + /// + /// Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).CreatedDate; } + + /// The name of the subscription, or null if the subscription has no name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically + /// cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following + /// format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? EndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).EndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).EndDate = value ?? default(global::System.DateTime); } + + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).ExpirationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).ExpirationDate = value ?? default(global::System.DateTime); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for CreatedDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractInternal.CreatedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).CreatedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).CreatedDate = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// + /// Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? NotificationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).NotificationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).NotificationDate = value ?? default(global::System.DateTime); } + + /// + /// The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} + /// where {userId} is a user identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OwnerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).OwnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).OwnerId = value ?? null; } + + /// + /// Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrimaryKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).PrimaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).PrimaryKey = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractProperties _property; + + /// Subscription contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContractProperties()); set => this._property = value; } + + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).Scope = value ?? null; } + + /// + /// Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SecondaryKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).SecondaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).SecondaryKey = value ?? null; } + + /// + /// Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? StartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).StartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).StartDate = value ?? default(global::System.DateTime); } + + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState)""); } + + /// + /// Optional subscription comment added by an administrator when the state is changed to the 'rejected'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string StateComment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).StateComment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal)Property).StateComment = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public SubscriptionContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Subscription details. + public partial interface ISubscriptionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Determines whether tracing is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether tracing is enabled", + SerializedName = @"allowTracing", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowTracing { get; set; } + /// + /// Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"createdDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDate { get; } + /// The name of the subscription, or null if the subscription has no name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the subscription, or null if the subscription has no name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically + /// cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following + /// format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndDate { get; set; } + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"expirationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationDate { get; set; } + /// + /// Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"notificationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? NotificationDate { get; set; } + /// + /// The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} + /// where {userId} is a user identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier.", + SerializedName = @"ownerId", + PossibleTypes = new [] { typeof(string) })] + string OwnerId { get; set; } + /// + /// Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"primaryKey", + PossibleTypes = new [] { typeof(string) })] + string PrimaryKey { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Scope like /products/{productId} or /apis or /apis/{apiId}.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// + /// Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"secondaryKey", + PossibleTypes = new [] { typeof(string) })] + string SecondaryKey { get; set; } + /// + /// Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartDate { get; set; } + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get; set; } + /// + /// Optional subscription comment added by an administrator when the state is changed to the 'rejected'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional subscription comment added by an administrator when the state is changed to the 'rejected'.", + SerializedName = @"stateComment", + PossibleTypes = new [] { typeof(string) })] + string StateComment { get; set; } + + } + /// Subscription details. + internal partial interface ISubscriptionContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Determines whether tracing is enabled + bool? AllowTracing { get; set; } + /// + /// Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? CreatedDate { get; set; } + /// The name of the subscription, or null if the subscription has no name. + string DisplayName { get; set; } + + string ETag { get; set; } + /// + /// Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically + /// cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following + /// format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + global::System.DateTime? EndDate { get; set; } + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + global::System.DateTime? ExpirationDate { get; set; } + /// + /// Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + global::System.DateTime? NotificationDate { get; set; } + /// + /// The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} + /// where {userId} is a user identifier. + /// + string OwnerId { get; set; } + /// + /// Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + string PrimaryKey { get; set; } + /// Subscription contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractProperties Property { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + string Scope { get; set; } + /// + /// Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + string SecondaryKey { get; set; } + /// + /// Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + global::System.DateTime? StartDate { get; set; } + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get; set; } + /// + /// Optional subscription comment added by an administrator when the state is changed to the 'rejected'. + /// + string StateComment { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContract.json.cs new file mode 100644 index 000000000000..bd30829b6cd4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription details. + public partial class SubscriptionContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContractProperties.cs new file mode 100644 index 000000000000..029dac308919 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContractProperties.cs @@ -0,0 +1,368 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription details. + public partial class SubscriptionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal + { + + /// Backing field for property. + private bool? _allowTracing; + + /// Determines whether tracing is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? AllowTracing { get => this._allowTracing; set => this._allowTracing = value; } + + /// Backing field for property. + private global::System.DateTime? _createdDate; + + /// + /// Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedDate { get => this._createdDate; } + + /// Backing field for property. + private string _displayName; + + /// The name of the subscription, or null if the subscription has no name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private global::System.DateTime? _endDate; + + /// + /// Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically + /// cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following + /// format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? EndDate { get => this._endDate; set => this._endDate = value; } + + /// Backing field for property. + private global::System.DateTime? _expirationDate; + + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationDate { get => this._expirationDate; set => this._expirationDate = value; } + + /// Internal Acessors for CreatedDate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractPropertiesInternal.CreatedDate { get => this._createdDate; set { {_createdDate = value;} } } + + /// Backing field for property. + private global::System.DateTime? _notificationDate; + + /// + /// Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? NotificationDate { get => this._notificationDate; set => this._notificationDate = value; } + + /// Backing field for property. + private string _ownerId; + + /// + /// The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} + /// where {userId} is a user identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string OwnerId { get => this._ownerId; set => this._ownerId = value; } + + /// Backing field for property. + private string _primaryKey; + + /// + /// Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrimaryKey { get => this._primaryKey; set => this._primaryKey = value; } + + /// Backing field for property. + private string _scope; + + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private string _secondaryKey; + + /// + /// Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SecondaryKey { get => this._secondaryKey; set => this._secondaryKey = value; } + + /// Backing field for property. + private global::System.DateTime? _startDate; + + /// + /// Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? StartDate { get => this._startDate; set => this._startDate = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState _state; + + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState State { get => this._state; set => this._state = value; } + + /// Backing field for property. + private string _stateComment; + + /// + /// Optional subscription comment added by an administrator when the state is changed to the 'rejected'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string StateComment { get => this._stateComment; set => this._stateComment = value; } + + /// Creates an new instance. + public SubscriptionContractProperties() + { + + } + } + /// Subscription details. + public partial interface ISubscriptionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether tracing is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether tracing is enabled", + SerializedName = @"allowTracing", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowTracing { get; set; } + /// + /// Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"createdDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDate { get; } + /// The name of the subscription, or null if the subscription has no name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the subscription, or null if the subscription has no name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically + /// cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following + /// format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndDate { get; set; } + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"expirationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationDate { get; set; } + /// + /// Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"notificationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? NotificationDate { get; set; } + /// + /// The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} + /// where {userId} is a user identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier.", + SerializedName = @"ownerId", + PossibleTypes = new [] { typeof(string) })] + string OwnerId { get; set; } + /// + /// Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"primaryKey", + PossibleTypes = new [] { typeof(string) })] + string PrimaryKey { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Scope like /products/{productId} or /apis or /apis/{apiId}.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// + /// Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", + SerializedName = @"secondaryKey", + PossibleTypes = new [] { typeof(string) })] + string SecondaryKey { get; set; } + /// + /// Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartDate { get; set; } + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState State { get; set; } + /// + /// Optional subscription comment added by an administrator when the state is changed to the 'rejected'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional subscription comment added by an administrator when the state is changed to the 'rejected'.", + SerializedName = @"stateComment", + PossibleTypes = new [] { typeof(string) })] + string StateComment { get; set; } + + } + /// Subscription details. + internal partial interface ISubscriptionContractPropertiesInternal + + { + /// Determines whether tracing is enabled + bool? AllowTracing { get; set; } + /// + /// Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + /// 8601 standard. + /// + global::System.DateTime? CreatedDate { get; set; } + /// The name of the subscription, or null if the subscription has no name. + string DisplayName { get; set; } + /// + /// Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically + /// cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following + /// format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + global::System.DateTime? EndDate { get; set; } + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + global::System.DateTime? ExpirationDate { get; set; } + /// + /// Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + global::System.DateTime? NotificationDate { get; set; } + /// + /// The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} + /// where {userId} is a user identifier. + /// + string OwnerId { get; set; } + /// + /// Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + string PrimaryKey { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + string Scope { get; set; } + /// + /// Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. + /// + string SecondaryKey { get; set; } + /// + /// Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + global::System.DateTime? StartDate { get; set; } + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState State { get; set; } + /// + /// Optional subscription comment added by an administrator when the state is changed to the 'rejected'. + /// + string StateComment { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContractProperties.json.cs new file mode 100644 index 000000000000..d2a2d12ab584 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionContractProperties.json.cs @@ -0,0 +1,135 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription details. + public partial class SubscriptionContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_ownerId = If( json?.PropertyT("ownerId"), out var __jsonOwnerId) ? (string)__jsonOwnerId : (string)OwnerId;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_createdDate = If( json?.PropertyT("createdDate"), out var __jsonCreatedDate) ? global::System.DateTime.TryParse((string)__jsonCreatedDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateValue) ? __jsonCreatedDateValue : CreatedDate : CreatedDate;} + {_startDate = If( json?.PropertyT("startDate"), out var __jsonStartDate) ? global::System.DateTime.TryParse((string)__jsonStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateValue) ? __jsonStartDateValue : StartDate : StartDate;} + {_expirationDate = If( json?.PropertyT("expirationDate"), out var __jsonExpirationDate) ? global::System.DateTime.TryParse((string)__jsonExpirationDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationDateValue) ? __jsonExpirationDateValue : ExpirationDate : ExpirationDate;} + {_endDate = If( json?.PropertyT("endDate"), out var __jsonEndDate) ? global::System.DateTime.TryParse((string)__jsonEndDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateValue) ? __jsonEndDateValue : EndDate : EndDate;} + {_notificationDate = If( json?.PropertyT("notificationDate"), out var __jsonNotificationDate) ? global::System.DateTime.TryParse((string)__jsonNotificationDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonNotificationDateValue) ? __jsonNotificationDateValue : NotificationDate : NotificationDate;} + {_primaryKey = If( json?.PropertyT("primaryKey"), out var __jsonPrimaryKey) ? (string)__jsonPrimaryKey : (string)PrimaryKey;} + {_secondaryKey = If( json?.PropertyT("secondaryKey"), out var __jsonSecondaryKey) ? (string)__jsonSecondaryKey : (string)SecondaryKey;} + {_stateComment = If( json?.PropertyT("stateComment"), out var __jsonStateComment) ? (string)__jsonStateComment : (string)StateComment;} + {_allowTracing = If( json?.PropertyT("allowTracing"), out var __jsonAllowTracing) ? (bool?)__jsonAllowTracing : AllowTracing;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._ownerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._ownerId.ToString()) : null, "ownerId" ,container.Add ); + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._createdDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._createdDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdDate" ,container.Add ); + } + AddIf( null != this._startDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._startDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startDate" ,container.Add ); + AddIf( null != this._expirationDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._expirationDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationDate" ,container.Add ); + AddIf( null != this._endDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._endDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endDate" ,container.Add ); + AddIf( null != this._notificationDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._notificationDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "notificationDate" ,container.Add ); + AddIf( null != (((object)this._primaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._primaryKey.ToString()) : null, "primaryKey" ,container.Add ); + AddIf( null != (((object)this._secondaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._secondaryKey.ToString()) : null, "secondaryKey" ,container.Add ); + AddIf( null != (((object)this._stateComment)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._stateComment.ToString()) : null, "stateComment" ,container.Add ); + AddIf( null != this._allowTracing ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._allowTracing) : null, "allowTracing" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameterProperties.cs new file mode 100644 index 000000000000..7466b6b551d5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameterProperties.cs @@ -0,0 +1,189 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create subscription operation. + public partial class SubscriptionCreateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal + { + + /// Backing field for property. + private bool? _allowTracing; + + /// Determines whether tracing can be enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? AllowTracing { get => this._allowTracing; set => this._allowTracing = value; } + + /// Backing field for property. + private string _displayName; + + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _ownerId; + + /// + /// User (user id path) for whom subscription is being created in form /users/{userId} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string OwnerId { get => this._ownerId; set => this._ownerId = value; } + + /// Backing field for property. + private string _primaryKey; + + /// + /// Primary subscription key. If not specified during request key will be generated automatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrimaryKey { get => this._primaryKey; set => this._primaryKey = value; } + + /// Backing field for property. + private string _scope; + + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private string _secondaryKey; + + /// + /// Secondary subscription key. If not specified during request key will be generated automatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SecondaryKey { get => this._secondaryKey; set => this._secondaryKey = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? _state; + + /// + /// Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are + /// * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs + /// of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or + /// rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has + /// been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get => this._state; set => this._state = value; } + + /// Creates an new instance. + public SubscriptionCreateParameterProperties() + { + + } + } + /// Parameters supplied to the Create subscription operation. + public partial interface ISubscriptionCreateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether tracing can be enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether tracing can be enabled", + SerializedName = @"allowTracing", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowTracing { get; set; } + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Subscription name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// User (user id path) for whom subscription is being created in form /users/{userId} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User (user id path) for whom subscription is being created in form /users/{userId}", + SerializedName = @"ownerId", + PossibleTypes = new [] { typeof(string) })] + string OwnerId { get; set; } + /// + /// Primary subscription key. If not specified during request key will be generated automatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Primary subscription key. If not specified during request key will be generated automatically.", + SerializedName = @"primaryKey", + PossibleTypes = new [] { typeof(string) })] + string PrimaryKey { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Scope like /products/{productId} or /apis or /apis/{apiId}.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// + /// Secondary subscription key. If not specified during request key will be generated automatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secondary subscription key. If not specified during request key will be generated automatically.", + SerializedName = @"secondaryKey", + PossibleTypes = new [] { typeof(string) })] + string SecondaryKey { get; set; } + /// + /// Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are + /// * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs + /// of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or + /// rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has + /// been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get; set; } + + } + /// Parameters supplied to the Create subscription operation. + internal partial interface ISubscriptionCreateParameterPropertiesInternal + + { + /// Determines whether tracing can be enabled + bool? AllowTracing { get; set; } + /// Subscription name. + string DisplayName { get; set; } + /// + /// User (user id path) for whom subscription is being created in form /users/{userId} + /// + string OwnerId { get; set; } + /// + /// Primary subscription key. If not specified during request key will be generated automatically. + /// + string PrimaryKey { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + string Scope { get; set; } + /// + /// Secondary subscription key. If not specified during request key will be generated automatically. + /// + string SecondaryKey { get; set; } + /// + /// Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are + /// * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs + /// of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or + /// rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has + /// been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameterProperties.json.cs new file mode 100644 index 000000000000..becf34884231 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameterProperties.json.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create subscription operation. + public partial class SubscriptionCreateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionCreateParameterProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionCreateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_ownerId = If( json?.PropertyT("ownerId"), out var __jsonOwnerId) ? (string)__jsonOwnerId : (string)OwnerId;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_primaryKey = If( json?.PropertyT("primaryKey"), out var __jsonPrimaryKey) ? (string)__jsonPrimaryKey : (string)PrimaryKey;} + {_secondaryKey = If( json?.PropertyT("secondaryKey"), out var __jsonSecondaryKey) ? (string)__jsonSecondaryKey : (string)SecondaryKey;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_allowTracing = If( json?.PropertyT("allowTracing"), out var __jsonAllowTracing) ? (bool?)__jsonAllowTracing : AllowTracing;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._ownerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._ownerId.ToString()) : null, "ownerId" ,container.Add ); + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._primaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._primaryKey.ToString()) : null, "primaryKey" ,container.Add ); + AddIf( null != (((object)this._secondaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._secondaryKey.ToString()) : null, "secondaryKey" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AddIf( null != this._allowTracing ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._allowTracing) : null, "allowTracing" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameters.cs new file mode 100644 index 000000000000..ba3aec98427d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameters.cs @@ -0,0 +1,180 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription create details. + public partial class SubscriptionCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParametersInternal + { + + /// Determines whether tracing can be enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? AllowTracing { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).AllowTracing; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).AllowTracing = value ?? default(bool); } + + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionCreateParameterProperties()); set { {_property = value;} } } + + /// + /// User (user id path) for whom subscription is being created in form /users/{userId} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OwnerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).OwnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).OwnerId = value ?? null; } + + /// + /// Primary subscription key. If not specified during request key will be generated automatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrimaryKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).PrimaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).PrimaryKey = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterProperties _property; + + /// Subscription contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionCreateParameterProperties()); set => this._property = value; } + + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).Scope = value ?? null; } + + /// + /// Secondary subscription key. If not specified during request key will be generated automatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SecondaryKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).SecondaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).SecondaryKey = value ?? null; } + + /// + /// Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are + /// * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs + /// of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or + /// rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has + /// been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterPropertiesInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState)""); } + + /// Creates an new instance. + public SubscriptionCreateParameters() + { + + } + } + /// Subscription create details. + public partial interface ISubscriptionCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether tracing can be enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether tracing can be enabled", + SerializedName = @"allowTracing", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowTracing { get; set; } + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// User (user id path) for whom subscription is being created in form /users/{userId} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User (user id path) for whom subscription is being created in form /users/{userId}", + SerializedName = @"ownerId", + PossibleTypes = new [] { typeof(string) })] + string OwnerId { get; set; } + /// + /// Primary subscription key. If not specified during request key will be generated automatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Primary subscription key. If not specified during request key will be generated automatically.", + SerializedName = @"primaryKey", + PossibleTypes = new [] { typeof(string) })] + string PrimaryKey { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Scope like /products/{productId} or /apis or /apis/{apiId}.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// + /// Secondary subscription key. If not specified during request key will be generated automatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secondary subscription key. If not specified during request key will be generated automatically.", + SerializedName = @"secondaryKey", + PossibleTypes = new [] { typeof(string) })] + string SecondaryKey { get; set; } + /// + /// Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are + /// * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs + /// of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or + /// rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has + /// been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get; set; } + + } + /// Subscription create details. + internal partial interface ISubscriptionCreateParametersInternal + + { + /// Determines whether tracing can be enabled + bool? AllowTracing { get; set; } + /// Subscription name. + string DisplayName { get; set; } + /// + /// User (user id path) for whom subscription is being created in form /users/{userId} + /// + string OwnerId { get; set; } + /// + /// Primary subscription key. If not specified during request key will be generated automatically. + /// + string PrimaryKey { get; set; } + /// Subscription contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameterProperties Property { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId}. + string Scope { get; set; } + /// + /// Secondary subscription key. If not specified during request key will be generated automatically. + /// + string SecondaryKey { get; set; } + /// + /// Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are + /// * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs + /// of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or + /// rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has + /// been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameters.json.cs new file mode 100644 index 000000000000..4199e00bbc17 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionCreateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription create details. + public partial class SubscriptionCreateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionCreateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionCreateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionCreateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionCreateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeyParameterNamesContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeyParameterNamesContract.cs new file mode 100644 index 000000000000..56f2a5841dbe --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeyParameterNamesContract.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription key parameter names details. + public partial class SubscriptionKeyParameterNamesContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContractInternal + { + + /// Backing field for property. + private string _header; + + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Header { get => this._header; set => this._header = value; } + + /// Backing field for property. + private string _query; + + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Query { get => this._query; set => this._query = value; } + + /// Creates an new instance. + public SubscriptionKeyParameterNamesContract() + { + + } + } + /// Subscription key parameter names details. + public partial interface ISubscriptionKeyParameterNamesContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Subscription key header name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription key header name.", + SerializedName = @"header", + PossibleTypes = new [] { typeof(string) })] + string Header { get; set; } + /// Subscription key query string parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription key query string parameter name.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(string) })] + string Query { get; set; } + + } + /// Subscription key parameter names details. + internal partial interface ISubscriptionKeyParameterNamesContractInternal + + { + /// Subscription key header name. + string Header { get; set; } + /// Subscription key query string parameter name. + string Query { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeyParameterNamesContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeyParameterNamesContract.json.cs new file mode 100644 index 000000000000..d27da97449f7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeyParameterNamesContract.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription key parameter names details. + public partial class SubscriptionKeyParameterNamesContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeyParameterNamesContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionKeyParameterNamesContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionKeyParameterNamesContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_header = If( json?.PropertyT("header"), out var __jsonHeader) ? (string)__jsonHeader : (string)Header;} + {_query = If( json?.PropertyT("query"), out var __jsonQuery) ? (string)__jsonQuery : (string)Query;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._header)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._header.ToString()) : null, "header" ,container.Add ); + AddIf( null != (((object)this._query)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._query.ToString()) : null, "query" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeysContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeysContract.cs new file mode 100644 index 000000000000..d826cb887299 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeysContract.cs @@ -0,0 +1,92 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription keys. + public partial class SubscriptionKeysContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeysContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeysContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Backing field for property. + private string _primaryKey; + + /// Subscription primary key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrimaryKey { get => this._primaryKey; set => this._primaryKey = value; } + + /// Backing field for property. + private string _secondaryKey; + + /// Subscription secondary key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SecondaryKey { get => this._secondaryKey; set => this._secondaryKey = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeysContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public SubscriptionKeysContract() + { + + } + } + /// Subscription keys. + public partial interface ISubscriptionKeysContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Subscription primary key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription primary key.", + SerializedName = @"primaryKey", + PossibleTypes = new [] { typeof(string) })] + string PrimaryKey { get; set; } + /// Subscription secondary key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription secondary key.", + SerializedName = @"secondaryKey", + PossibleTypes = new [] { typeof(string) })] + string SecondaryKey { get; set; } + + } + /// Subscription keys. + internal partial interface ISubscriptionKeysContractInternal + + { + string ETag { get; set; } + /// Subscription primary key. + string PrimaryKey { get; set; } + /// Subscription secondary key. + string SecondaryKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeysContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeysContract.json.cs new file mode 100644 index 000000000000..356a73783140 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionKeysContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription keys. + public partial class SubscriptionKeysContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeysContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeysContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionKeysContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionKeysContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionKeysContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_primaryKey = If( json?.PropertyT("primaryKey"), out var __jsonPrimaryKey) ? (string)__jsonPrimaryKey : (string)PrimaryKey;} + {_secondaryKey = If( json?.PropertyT("secondaryKey"), out var __jsonSecondaryKey) ? (string)__jsonSecondaryKey : (string)SecondaryKey;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._primaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._primaryKey.ToString()) : null, "primaryKey" ,container.Add ); + AddIf( null != (((object)this._secondaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._secondaryKey.ToString()) : null, "secondaryKey" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameterProperties.cs new file mode 100644 index 000000000000..db8960f6f456 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameterProperties.cs @@ -0,0 +1,223 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update subscription operation. + public partial class SubscriptionUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal + { + + /// Backing field for property. + private bool? _allowTracing; + + /// Determines whether tracing can be enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? AllowTracing { get => this._allowTracing; set => this._allowTracing = value; } + + /// Backing field for property. + private string _displayName; + + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private global::System.DateTime? _expirationDate; + + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationDate { get => this._expirationDate; set => this._expirationDate = value; } + + /// Backing field for property. + private string _ownerId; + + /// User identifier path: /users/{userId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string OwnerId { get => this._ownerId; set => this._ownerId = value; } + + /// Backing field for property. + private string _primaryKey; + + /// Primary subscription key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrimaryKey { get => this._primaryKey; set => this._primaryKey = value; } + + /// Backing field for property. + private string _scope; + + /// Scope like /products/{productId} or /apis or /apis/{apiId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private string _secondaryKey; + + /// Secondary subscription key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SecondaryKey { get => this._secondaryKey; set => this._secondaryKey = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? _state; + + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get => this._state; set => this._state = value; } + + /// Backing field for property. + private string _stateComment; + + /// + /// Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string StateComment { get => this._stateComment; set => this._stateComment = value; } + + /// Creates an new instance. + public SubscriptionUpdateParameterProperties() + { + + } + } + /// Parameters supplied to the Update subscription operation. + public partial interface ISubscriptionUpdateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether tracing can be enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether tracing can be enabled", + SerializedName = @"allowTracing", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowTracing { get; set; } + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.", + SerializedName = @"expirationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationDate { get; set; } + /// User identifier path: /users/{userId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User identifier path: /users/{userId}", + SerializedName = @"ownerId", + PossibleTypes = new [] { typeof(string) })] + string OwnerId { get; set; } + /// Primary subscription key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Primary subscription key.", + SerializedName = @"primaryKey", + PossibleTypes = new [] { typeof(string) })] + string PrimaryKey { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Scope like /products/{productId} or /apis or /apis/{apiId}", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// Secondary subscription key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secondary subscription key.", + SerializedName = @"secondaryKey", + PossibleTypes = new [] { typeof(string) })] + string SecondaryKey { get; set; } + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get; set; } + /// + /// Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comments describing subscription state change by the administrator when the state is changed to the 'rejected'.", + SerializedName = @"stateComment", + PossibleTypes = new [] { typeof(string) })] + string StateComment { get; set; } + + } + /// Parameters supplied to the Update subscription operation. + internal partial interface ISubscriptionUpdateParameterPropertiesInternal + + { + /// Determines whether tracing can be enabled + bool? AllowTracing { get; set; } + /// Subscription name. + string DisplayName { get; set; } + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + global::System.DateTime? ExpirationDate { get; set; } + /// User identifier path: /users/{userId} + string OwnerId { get; set; } + /// Primary subscription key. + string PrimaryKey { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId} + string Scope { get; set; } + /// Secondary subscription key. + string SecondaryKey { get; set; } + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get; set; } + /// + /// Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. + /// + string StateComment { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameterProperties.json.cs new file mode 100644 index 000000000000..7277463a3377 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameterProperties.json.cs @@ -0,0 +1,125 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update subscription operation. + public partial class SubscriptionUpdateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionUpdateParameterProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionUpdateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_ownerId = If( json?.PropertyT("ownerId"), out var __jsonOwnerId) ? (string)__jsonOwnerId : (string)OwnerId;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_expirationDate = If( json?.PropertyT("expirationDate"), out var __jsonExpirationDate) ? global::System.DateTime.TryParse((string)__jsonExpirationDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationDateValue) ? __jsonExpirationDateValue : ExpirationDate : ExpirationDate;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_primaryKey = If( json?.PropertyT("primaryKey"), out var __jsonPrimaryKey) ? (string)__jsonPrimaryKey : (string)PrimaryKey;} + {_secondaryKey = If( json?.PropertyT("secondaryKey"), out var __jsonSecondaryKey) ? (string)__jsonSecondaryKey : (string)SecondaryKey;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_stateComment = If( json?.PropertyT("stateComment"), out var __jsonStateComment) ? (string)__jsonStateComment : (string)StateComment;} + {_allowTracing = If( json?.PropertyT("allowTracing"), out var __jsonAllowTracing) ? (bool?)__jsonAllowTracing : AllowTracing;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._ownerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._ownerId.ToString()) : null, "ownerId" ,container.Add ); + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + AddIf( null != this._expirationDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._expirationDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationDate" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._primaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._primaryKey.ToString()) : null, "primaryKey" ,container.Add ); + AddIf( null != (((object)this._secondaryKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._secondaryKey.ToString()) : null, "secondaryKey" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AddIf( null != (((object)this._stateComment)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._stateComment.ToString()) : null, "stateComment" ,container.Add ); + AddIf( null != this._allowTracing ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._allowTracing) : null, "allowTracing" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameters.cs new file mode 100644 index 000000000000..c3c5696e8fa9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameters.cs @@ -0,0 +1,208 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription update details. + public partial class SubscriptionUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParametersInternal + { + + /// Determines whether tracing can be enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? AllowTracing { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).AllowTracing; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).AllowTracing = value ?? default(bool); } + + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).DisplayName = value ?? null; } + + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).ExpirationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).ExpirationDate = value ?? default(global::System.DateTime); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionUpdateParameterProperties()); set { {_property = value;} } } + + /// User identifier path: /users/{userId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OwnerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).OwnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).OwnerId = value ?? null; } + + /// Primary subscription key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string PrimaryKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).PrimaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).PrimaryKey = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterProperties _property; + + /// Subscription Update contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionUpdateParameterProperties()); set => this._property = value; } + + /// Scope like /products/{productId} or /apis or /apis/{apiId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).Scope = value ?? null; } + + /// Secondary subscription key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string SecondaryKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).SecondaryKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).SecondaryKey = value ?? null; } + + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState)""); } + + /// + /// Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string StateComment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).StateComment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterPropertiesInternal)Property).StateComment = value ?? null; } + + /// Creates an new instance. + public SubscriptionUpdateParameters() + { + + } + } + /// Subscription update details. + public partial interface ISubscriptionUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Determines whether tracing can be enabled + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines whether tracing can be enabled", + SerializedName = @"allowTracing", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowTracing { get; set; } + /// Subscription name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.", + SerializedName = @"expirationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationDate { get; set; } + /// User identifier path: /users/{userId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User identifier path: /users/{userId}", + SerializedName = @"ownerId", + PossibleTypes = new [] { typeof(string) })] + string OwnerId { get; set; } + /// Primary subscription key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Primary subscription key.", + SerializedName = @"primaryKey", + PossibleTypes = new [] { typeof(string) })] + string PrimaryKey { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Scope like /products/{productId} or /apis or /apis/{apiId}", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + string Scope { get; set; } + /// Secondary subscription key. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secondary subscription key.", + SerializedName = @"secondaryKey", + PossibleTypes = new [] { typeof(string) })] + string SecondaryKey { get; set; } + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get; set; } + /// + /// Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comments describing subscription state change by the administrator when the state is changed to the 'rejected'.", + SerializedName = @"stateComment", + PossibleTypes = new [] { typeof(string) })] + string StateComment { get; set; } + + } + /// Subscription update details. + internal partial interface ISubscriptionUpdateParametersInternal + + { + /// Determines whether tracing can be enabled + bool? AllowTracing { get; set; } + /// Subscription name. + string DisplayName { get; set; } + /// + /// Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. + /// The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + /// as specified by the ISO 8601 standard. + /// + global::System.DateTime? ExpirationDate { get; set; } + /// User identifier path: /users/{userId} + string OwnerId { get; set; } + /// Primary subscription key. + string PrimaryKey { get; set; } + /// Subscription Update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameterProperties Property { get; set; } + /// Scope like /products/{productId} or /apis or /apis/{apiId} + string Scope { get; set; } + /// Secondary subscription key. + string SecondaryKey { get; set; } + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState? State { get; set; } + /// + /// Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. + /// + string StateComment { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameters.json.cs new file mode 100644 index 000000000000..06d578ed6f87 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscription update details. + public partial class SubscriptionUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.SubscriptionUpdateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionsDelegationSettingsProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionsDelegationSettingsProperties.cs new file mode 100644 index 000000000000..e8339306b395 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionsDelegationSettingsProperties.cs @@ -0,0 +1,53 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscriptions delegation settings properties. + public partial class SubscriptionsDelegationSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsPropertiesInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Enable or disable delegation for subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public SubscriptionsDelegationSettingsProperties() + { + + } + } + /// Subscriptions delegation settings properties. + public partial interface ISubscriptionsDelegationSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Enable or disable delegation for subscriptions. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable delegation for subscriptions.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Subscriptions delegation settings properties. + internal partial interface ISubscriptionsDelegationSettingsPropertiesInternal + + { + /// Enable or disable delegation for subscriptions. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionsDelegationSettingsProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionsDelegationSettingsProperties.json.cs new file mode 100644 index 000000000000..c34bd5ec8f43 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/SubscriptionsDelegationSettingsProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Subscriptions delegation settings properties. + public partial class SubscriptionsDelegationSettingsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ISubscriptionsDelegationSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionsDelegationSettingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionsDelegationSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkCollection.cs new file mode 100644 index 000000000000..162068137e97 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag-API link list representation. + public partial class TagApiLinkCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TagApiLinkCollection() + { + + } + } + /// Paged Tag-API link list representation. + public partial interface ITagApiLinkCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract[] Value { get; set; } + + } + /// Paged Tag-API link list representation. + internal partial interface ITagApiLinkCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkCollection.json.cs new file mode 100644 index 000000000000..db541187a16c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag-API link list representation. + public partial class TagApiLinkCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagApiLinkCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagApiLinkCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContract.cs new file mode 100644 index 000000000000..bf4fe041710e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContract.cs @@ -0,0 +1,129 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-API link details. + public partial class TagApiLinkContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Full resource Id of an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ApiId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractPropertiesInternal)Property).ApiId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractPropertiesInternal)Property).ApiId = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractProperties _property; + + /// Tag-API link entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public TagApiLinkContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Tag-API link details. + public partial interface ITagApiLinkContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Full resource Id of an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Full resource Id of an API.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + /// Tag-API link details. + internal partial interface ITagApiLinkContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Full resource Id of an API. + string ApiId { get; set; } + + string ETag { get; set; } + /// Tag-API link entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContract.json.cs new file mode 100644 index 000000000000..822350b34c34 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-API link details. + public partial class TagApiLinkContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagApiLinkContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagApiLinkContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagApiLinkContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContractProperties.cs new file mode 100644 index 000000000000..0bbe7c0959d8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-API link entity properties. + public partial class TagApiLinkContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractPropertiesInternal + { + + /// Backing field for property. + private string _apiId; + + /// Full resource Id of an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiId { get => this._apiId; set => this._apiId = value; } + + /// Creates an new instance. + public TagApiLinkContractProperties() + { + + } + } + /// Tag-API link entity properties. + public partial interface ITagApiLinkContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Full resource Id of an API. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Full resource Id of an API.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + + } + /// Tag-API link entity properties. + internal partial interface ITagApiLinkContractPropertiesInternal + + { + /// Full resource Id of an API. + string ApiId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContractProperties.json.cs new file mode 100644 index 000000000000..3f9f19ba0609 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagApiLinkContractProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-API link entity properties. + public partial class TagApiLinkContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagApiLinkContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagApiLinkContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagApiLinkContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_apiId = If( json?.PropertyT("apiId"), out var __jsonApiId) ? (string)__jsonApiId : (string)ApiId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._apiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiId.ToString()) : null, "apiId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCollection.cs new file mode 100644 index 000000000000..11f05ac3ac31 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag list representation. + public partial class TagCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TagCollection() + { + + } + } + /// Paged Tag list representation. + public partial interface ITagCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContract[] Value { get; set; } + + } + /// Paged Tag list representation. + internal partial interface ITagCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCollection.json.cs new file mode 100644 index 000000000000..60c04a4a80cb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag list representation. + public partial class TagCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContract.cs new file mode 100644 index 000000000000..2009ed2abe5e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContract.cs @@ -0,0 +1,129 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag Contract details. + public partial class TagContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Tag name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties _property; + + /// Tag entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public TagContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Tag Contract details. + public partial interface ITagContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Tag name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + /// Tag Contract details. + internal partial interface ITagContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Tag name. + string DisplayName { get; set; } + + string ETag { get; set; } + /// Tag entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContract.json.cs new file mode 100644 index 000000000000..fd4068380b8e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag Contract details. + public partial class TagContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContractProperties.cs new file mode 100644 index 000000000000..ab41546b9087 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag contract Properties. + public partial class TagContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractPropertiesInternal + { + + /// Backing field for property. + private string _displayName; + + /// Tag name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Creates an new instance. + public TagContractProperties() + { + + } + } + /// Tag contract Properties. + public partial interface ITagContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Tag name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Tag name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + } + /// Tag contract Properties. + internal partial interface ITagContractPropertiesInternal + + { + /// Tag name. + string DisplayName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContractProperties.json.cs new file mode 100644 index 000000000000..37f8f23ef5cf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagContractProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag contract Properties. + public partial class TagContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCreateUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCreateUpdateParameters.cs new file mode 100644 index 000000000000..ff56d14bcbcf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCreateUpdateParameters.cs @@ -0,0 +1,60 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to Create/Update Tag operations. + public partial class TagCreateUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParametersInternal + { + + /// Tag name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties _property; + + /// Properties supplied to Create Tag operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContractProperties()); set => this._property = value; } + + /// Creates an new instance. + public TagCreateUpdateParameters() + { + + } + } + /// Parameters supplied to Create/Update Tag operations. + public partial interface ITagCreateUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Tag name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + } + /// Parameters supplied to Create/Update Tag operations. + internal partial interface ITagCreateUpdateParametersInternal + + { + /// Tag name. + string DisplayName { get; set; } + /// Properties supplied to Create Tag operation. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCreateUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCreateUpdateParameters.json.cs new file mode 100644 index 000000000000..5c8fe36bd58f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagCreateUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to Create/Update Tag operations. + public partial class TagCreateUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagCreateUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagCreateUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagCreateUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionBaseProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionBaseProperties.cs new file mode 100644 index 000000000000..e07f3d8acd9a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionBaseProperties.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create TagDescription operation. + public partial class TagDescriptionBaseProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBaseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _externalDocsDescription; + + /// Description of the external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ExternalDocsDescription { get => this._externalDocsDescription; set => this._externalDocsDescription = value; } + + /// Backing field for property. + private string _externalDocsUrl; + + /// Absolute URL of external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ExternalDocsUrl { get => this._externalDocsUrl; set => this._externalDocsUrl = value; } + + /// Creates an new instance. + public TagDescriptionBaseProperties() + { + + } + } + /// Parameters supplied to the Create TagDescription operation. + public partial interface ITagDescriptionBaseProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of the Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the Tag.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Description of the external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the external resources describing the tag.", + SerializedName = @"externalDocsDescription", + PossibleTypes = new [] { typeof(string) })] + string ExternalDocsDescription { get; set; } + /// Absolute URL of external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Absolute URL of external resources describing the tag.", + SerializedName = @"externalDocsUrl", + PossibleTypes = new [] { typeof(string) })] + string ExternalDocsUrl { get; set; } + + } + /// Parameters supplied to the Create TagDescription operation. + internal partial interface ITagDescriptionBasePropertiesInternal + + { + /// Description of the Tag. + string Description { get; set; } + /// Description of the external resources describing the tag. + string ExternalDocsDescription { get; set; } + /// Absolute URL of external resources describing the tag. + string ExternalDocsUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionBaseProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionBaseProperties.json.cs new file mode 100644 index 000000000000..76655967f351 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionBaseProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create TagDescription operation. + public partial class TagDescriptionBaseProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBaseProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBaseProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBaseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagDescriptionBaseProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagDescriptionBaseProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_externalDocsUrl = If( json?.PropertyT("externalDocsUrl"), out var __jsonExternalDocsUrl) ? (string)__jsonExternalDocsUrl : (string)ExternalDocsUrl;} + {_externalDocsDescription = If( json?.PropertyT("externalDocsDescription"), out var __jsonExternalDocsDescription) ? (string)__jsonExternalDocsDescription : (string)ExternalDocsDescription;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._externalDocsUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._externalDocsUrl.ToString()) : null, "externalDocsUrl" ,container.Add ); + AddIf( null != (((object)this._externalDocsDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._externalDocsDescription.ToString()) : null, "externalDocsDescription" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCollection.cs new file mode 100644 index 000000000000..857ad40e5f43 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged TagDescription list representation. + public partial class TagDescriptionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TagDescriptionCollection() + { + + } + } + /// Paged TagDescription list representation. + public partial interface ITagDescriptionCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContract[] Value { get; set; } + + } + /// Paged TagDescription list representation. + internal partial interface ITagDescriptionCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCollection.json.cs new file mode 100644 index 000000000000..6104d53ef87b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged TagDescription list representation. + public partial class TagDescriptionCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagDescriptionCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagDescriptionCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContract.cs new file mode 100644 index 000000000000..fe7dc488693e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContract.cs @@ -0,0 +1,185 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Contract details. + public partial class TagDescriptionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Description of the Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).Description = value ?? null; } + + /// Tag name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Description of the external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ExternalDocsDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsDescription = value ?? null; } + + /// Absolute URL of external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ExternalDocsUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsUrl = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractProperties _property; + + /// TagDescription entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionContractProperties()); set => this._property = value; } + + /// Identifier of the tag in the form of /tags/{tagId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TagId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractPropertiesInternal)Property).TagId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractPropertiesInternal)Property).TagId = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public TagDescriptionContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Contract details. + public partial interface ITagDescriptionContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Description of the Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the Tag.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Tag name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Description of the external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the external resources describing the tag.", + SerializedName = @"externalDocsDescription", + PossibleTypes = new [] { typeof(string) })] + string ExternalDocsDescription { get; set; } + /// Absolute URL of external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Absolute URL of external resources describing the tag.", + SerializedName = @"externalDocsUrl", + PossibleTypes = new [] { typeof(string) })] + string ExternalDocsUrl { get; set; } + /// Identifier of the tag in the form of /tags/{tagId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the tag in the form of /tags/{tagId}", + SerializedName = @"tagId", + PossibleTypes = new [] { typeof(string) })] + string TagId { get; set; } + + } + /// Contract details. + internal partial interface ITagDescriptionContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Description of the Tag. + string Description { get; set; } + /// Tag name. + string DisplayName { get; set; } + + string ETag { get; set; } + /// Description of the external resources describing the tag. + string ExternalDocsDescription { get; set; } + /// Absolute URL of external resources describing the tag. + string ExternalDocsUrl { get; set; } + /// TagDescription entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractProperties Property { get; set; } + /// Identifier of the tag in the form of /tags/{tagId} + string TagId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContract.json.cs new file mode 100644 index 000000000000..49d3f4618771 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Contract details. + public partial class TagDescriptionContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagDescriptionContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagDescriptionContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContractProperties.cs new file mode 100644 index 000000000000..1ae23e2da82d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContractProperties.cs @@ -0,0 +1,99 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// TagDescription contract Properties. + public partial class TagDescriptionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBaseProperties __tagDescriptionBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionBaseProperties(); + + /// Description of the Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)__tagDescriptionBaseProperties).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)__tagDescriptionBaseProperties).Description = value ?? null; } + + /// Backing field for property. + private string _displayName; + + /// Tag name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Description of the external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ExternalDocsDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)__tagDescriptionBaseProperties).ExternalDocsDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)__tagDescriptionBaseProperties).ExternalDocsDescription = value ?? null; } + + /// Absolute URL of external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string ExternalDocsUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)__tagDescriptionBaseProperties).ExternalDocsUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)__tagDescriptionBaseProperties).ExternalDocsUrl = value ?? null; } + + /// Backing field for property. + private string _tagId; + + /// Identifier of the tag in the form of /tags/{tagId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TagId { get => this._tagId; set => this._tagId = value; } + + /// Creates an new instance. + public TagDescriptionContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__tagDescriptionBaseProperties), __tagDescriptionBaseProperties); + await eventListener.AssertObjectIsValid(nameof(__tagDescriptionBaseProperties), __tagDescriptionBaseProperties); + } + } + /// TagDescription contract Properties. + public partial interface ITagDescriptionContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBaseProperties + { + /// Tag name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag name.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Identifier of the tag in the form of /tags/{tagId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the tag in the form of /tags/{tagId}", + SerializedName = @"tagId", + PossibleTypes = new [] { typeof(string) })] + string TagId { get; set; } + + } + /// TagDescription contract Properties. + internal partial interface ITagDescriptionContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal + { + /// Tag name. + string DisplayName { get; set; } + /// Identifier of the tag in the form of /tags/{tagId} + string TagId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContractProperties.json.cs new file mode 100644 index 000000000000..8d16bcaa94d1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionContractProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// TagDescription contract Properties. + public partial class TagDescriptionContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagDescriptionContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagDescriptionContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __tagDescriptionBaseProperties = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionBaseProperties(json); + {_tagId = If( json?.PropertyT("tagId"), out var __jsonTagId) ? (string)__jsonTagId : (string)TagId;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __tagDescriptionBaseProperties?.ToJson(container, serializationMode); + AddIf( null != (((object)this._tagId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._tagId.ToString()) : null, "tagId" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCreateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCreateParameters.cs new file mode 100644 index 000000000000..54296969a20c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCreateParameters.cs @@ -0,0 +1,88 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create TagDescription operation. + public partial class TagDescriptionCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCreateParametersInternal + { + + /// Description of the Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).Description = value ?? null; } + + /// Description of the external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ExternalDocsDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsDescription = value ?? null; } + + /// Absolute URL of external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ExternalDocsUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBasePropertiesInternal)Property).ExternalDocsUrl = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBaseProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionBaseProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBaseProperties _property; + + /// Properties supplied to Create TagDescription operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBaseProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionBaseProperties()); set => this._property = value; } + + /// Creates an new instance. + public TagDescriptionCreateParameters() + { + + } + } + /// Parameters supplied to the Create TagDescription operation. + public partial interface ITagDescriptionCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of the Tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the Tag.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Description of the external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the external resources describing the tag.", + SerializedName = @"externalDocsDescription", + PossibleTypes = new [] { typeof(string) })] + string ExternalDocsDescription { get; set; } + /// Absolute URL of external resources describing the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Absolute URL of external resources describing the tag.", + SerializedName = @"externalDocsUrl", + PossibleTypes = new [] { typeof(string) })] + string ExternalDocsUrl { get; set; } + + } + /// Parameters supplied to the Create TagDescription operation. + internal partial interface ITagDescriptionCreateParametersInternal + + { + /// Description of the Tag. + string Description { get; set; } + /// Description of the external resources describing the tag. + string ExternalDocsDescription { get; set; } + /// Absolute URL of external resources describing the tag. + string ExternalDocsUrl { get; set; } + /// Properties supplied to Create TagDescription operation. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionBaseProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCreateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCreateParameters.json.cs new file mode 100644 index 000000000000..0847a4b33b49 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagDescriptionCreateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create TagDescription operation. + public partial class TagDescriptionCreateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagDescriptionCreateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagDescriptionCreateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagDescriptionCreateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagDescriptionBaseProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkCollection.cs new file mode 100644 index 000000000000..f620e644f802 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag-operation link list representation. + public partial class TagOperationLinkCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TagOperationLinkCollection() + { + + } + } + /// Paged Tag-operation link list representation. + public partial interface ITagOperationLinkCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract[] Value { get; set; } + + } + /// Paged Tag-operation link list representation. + internal partial interface ITagOperationLinkCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkCollection.json.cs new file mode 100644 index 000000000000..406631633283 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag-operation link list representation. + public partial class TagOperationLinkCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagOperationLinkCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagOperationLinkCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContract.cs new file mode 100644 index 000000000000..05176d4ffd86 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContract.cs @@ -0,0 +1,127 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-operation link details. + public partial class TagOperationLinkContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Full resource Id of an API operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OperationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractPropertiesInternal)Property).OperationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractPropertiesInternal)Property).OperationId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractProperties _property; + + /// Tag-API link entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public TagOperationLinkContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Tag-operation link details. + public partial interface ITagOperationLinkContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Full resource Id of an API operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Full resource Id of an API operation.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + + } + /// Tag-operation link details. + internal partial interface ITagOperationLinkContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Full resource Id of an API operation. + string OperationId { get; set; } + /// Tag-API link entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContract.json.cs new file mode 100644 index 000000000000..84a0d3460e8b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-operation link details. + public partial class TagOperationLinkContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagOperationLinkContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagOperationLinkContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagOperationLinkContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContractProperties.cs new file mode 100644 index 000000000000..ddc9f6f84c93 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-operation link entity properties. + public partial class TagOperationLinkContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractPropertiesInternal + { + + /// Backing field for property. + private string _operationId; + + /// Full resource Id of an API operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// Creates an new instance. + public TagOperationLinkContractProperties() + { + + } + } + /// Tag-operation link entity properties. + public partial interface ITagOperationLinkContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Full resource Id of an API operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Full resource Id of an API operation.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + + } + /// Tag-operation link entity properties. + internal partial interface ITagOperationLinkContractPropertiesInternal + + { + /// Full resource Id of an API operation. + string OperationId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContractProperties.json.cs new file mode 100644 index 000000000000..94ee3dec7095 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagOperationLinkContractProperties.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-operation link entity properties. + public partial class TagOperationLinkContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagOperationLinkContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagOperationLinkContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagOperationLinkContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._operationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._operationId.ToString()) : null, "operationId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkCollection.cs new file mode 100644 index 000000000000..9c2e046ed80e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag-product link list representation. + public partial class TagProductLinkCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TagProductLinkCollection() + { + + } + } + /// Paged Tag-product link list representation. + public partial interface ITagProductLinkCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract[] Value { get; set; } + + } + /// Paged Tag-product link list representation. + internal partial interface ITagProductLinkCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkCollection.json.cs new file mode 100644 index 000000000000..187253a8ab66 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag-product link list representation. + public partial class TagProductLinkCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagProductLinkCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagProductLinkCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContract.cs new file mode 100644 index 000000000000..f0f8605f5d9a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContract.cs @@ -0,0 +1,127 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-product link details. + public partial class TagProductLinkContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Full resource Id of a product. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProductId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractPropertiesInternal)Property).ProductId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractPropertiesInternal)Property).ProductId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractProperties _property; + + /// Tag-API link entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public TagProductLinkContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Tag-product link details. + public partial interface ITagProductLinkContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Full resource Id of a product. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Full resource Id of a product.", + SerializedName = @"productId", + PossibleTypes = new [] { typeof(string) })] + string ProductId { get; set; } + + } + /// Tag-product link details. + internal partial interface ITagProductLinkContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Full resource Id of a product. + string ProductId { get; set; } + /// Tag-API link entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContract.json.cs new file mode 100644 index 000000000000..26c419416187 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-product link details. + public partial class TagProductLinkContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagProductLinkContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagProductLinkContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagProductLinkContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContractProperties.cs new file mode 100644 index 000000000000..7f3d2fe4987c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-product link entity properties. + public partial class TagProductLinkContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractPropertiesInternal + { + + /// Backing field for property. + private string _productId; + + /// Full resource Id of a product. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProductId { get => this._productId; set => this._productId = value; } + + /// Creates an new instance. + public TagProductLinkContractProperties() + { + + } + } + /// Tag-product link entity properties. + public partial interface ITagProductLinkContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Full resource Id of a product. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Full resource Id of a product.", + SerializedName = @"productId", + PossibleTypes = new [] { typeof(string) })] + string ProductId { get; set; } + + } + /// Tag-product link entity properties. + internal partial interface ITagProductLinkContractPropertiesInternal + + { + /// Full resource Id of a product. + string ProductId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContractProperties.json.cs new file mode 100644 index 000000000000..bb029305e061 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagProductLinkContractProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tag-product link entity properties. + public partial class TagProductLinkContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagProductLinkContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagProductLinkContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagProductLinkContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_productId = If( json?.PropertyT("productId"), out var __jsonProductId) ? (string)__jsonProductId : (string)ProductId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._productId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._productId.ToString()) : null, "productId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceCollection.cs new file mode 100644 index 000000000000..e32bb7b1115e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag list representation. + public partial class TagResourceCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TagResourceCollection() + { + + } + } + /// Paged Tag list representation. + public partial interface ITagResourceCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContract[] Value { get; set; } + + } + /// Paged Tag list representation. + internal partial interface ITagResourceCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceCollection.json.cs new file mode 100644 index 000000000000..dbf9f952d7ed --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Tag list representation. + public partial class TagResourceCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagResourceCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagResourceCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagResourceContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContract.cs new file mode 100644 index 000000000000..3476aa8c8f05 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContract.cs @@ -0,0 +1,429 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// TagResource contract properties. + public partial class TagResourceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiTagResourceContractProperties _api; + + /// API associated with the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiTagResourceContractProperties Api { get => (this._api = this._api ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiTagResourceContractProperties()); set => this._api = value; } + + /// Internal Acessors for Operation + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal.Operation { get => (this._operation = this._operation ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationTagResourceContractProperties()); set { {_operation = value;} } } + + /// Internal Acessors for OperationApiName + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal.OperationApiName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).ApiName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).ApiName = value; } + + /// Internal Acessors for OperationApiRevision + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal.OperationApiRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).ApiRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).ApiRevision = value; } + + /// Internal Acessors for OperationApiVersion + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal.OperationApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).ApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).ApiVersion = value; } + + /// Internal Acessors for OperationDescription + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal.OperationDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Description = value; } + + /// Internal Acessors for OperationMethod + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal.OperationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Method; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Method = value; } + + /// Internal Acessors for OperationName + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal.OperationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Name = value; } + + /// Internal Acessors for OperationUrlTemplate + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal.OperationUrlTemplate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).UrlTemplate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).UrlTemplate = value; } + + /// Internal Acessors for Product + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal.Product { get => (this._product = this._product ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductTagResourceContractProperties()); set { {_product = value;} } } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagResourceContractProperties()); set { {_tag = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractProperties _operation; + + /// Operation associated with the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractProperties Operation { get => (this._operation = this._operation ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationTagResourceContractProperties()); set => this._operation = value; } + + /// API Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OperationApiName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).ApiName; } + + /// API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OperationApiRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).ApiRevision; } + + /// API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OperationApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).ApiVersion; } + + /// Operation Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OperationDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Description; } + + /// Identifier of the operation in form /operations/{operationId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OperationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Id = value ?? null; } + + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OperationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Method; } + + /// Operation name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OperationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).Name; } + + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string OperationUrlTemplate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractPropertiesInternal)Operation).UrlTemplate; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractProperties _product; + + /// Product associated with the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractProperties Product { get => (this._product = this._product ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductTagResourceContractProperties()); set => this._product = value; } + + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? ProductApprovalRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).ApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).ApprovalRequired = value ?? default(bool); } + + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProductDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).Description = value ?? null; } + + /// Identifier of the product in the form of /products/{productId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProductId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractPropertiesInternal)Product).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractPropertiesInternal)Product).Id = value ?? null; } + + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProductName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractPropertiesInternal)Product).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractPropertiesInternal)Product).Name = value ?? null; } + + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? ProductState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState)""); } + + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? ProductSubscriptionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).SubscriptionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).SubscriptionRequired = value ?? default(bool); } + + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public int? ProductSubscriptionsLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).SubscriptionsLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).SubscriptionsLimit = value ?? default(int); } + + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string ProductTerm { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductEntityBaseParametersInternal)Product).Term = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractProperties _tag; + + /// Tag associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractProperties Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagResourceContractProperties()); set => this._tag = value; } + + /// Tag identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TagId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractPropertiesInternal)Tag).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractPropertiesInternal)Tag).Id = value ?? null; } + + /// Tag Name + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractPropertiesInternal)Tag).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractPropertiesInternal)Tag).Name = value ?? null; } + + /// Creates an new instance. + public TagResourceContract() + { + + } + } + /// TagResource contract properties. + public partial interface ITagResourceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// API associated with the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API associated with the tag.", + SerializedName = @"api", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiTagResourceContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiTagResourceContractProperties Api { get; set; } + /// API Name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"API Name.", + SerializedName = @"apiName", + PossibleTypes = new [] { typeof(string) })] + string OperationApiName { get; } + /// API Revision. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"API Revision.", + SerializedName = @"apiRevision", + PossibleTypes = new [] { typeof(string) })] + string OperationApiRevision { get; } + /// API Version. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"API Version.", + SerializedName = @"apiVersion", + PossibleTypes = new [] { typeof(string) })] + string OperationApiVersion { get; } + /// Operation Description. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation Description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string OperationDescription { get; } + /// Identifier of the operation in form /operations/{operationId}. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the operation in form /operations/{operationId}.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.", + SerializedName = @"method", + PossibleTypes = new [] { typeof(string) })] + string OperationMethod { get; } + /// Operation name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string OperationName { get; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}", + SerializedName = @"urlTemplate", + PossibleTypes = new [] { typeof(string) })] + string OperationUrlTemplate { get; } + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false.", + SerializedName = @"approvalRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? ProductApprovalRequired { get; set; } + /// Product description. May include HTML formatting tags. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product description. May include HTML formatting tags.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string ProductDescription { get; set; } + /// Identifier of the product in the form of /products/{productId} + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the product in the form of /products/{productId}", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string ProductId { get; set; } + /// Product name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ProductName { get; set; } + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? ProductState { get; set; } + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as ""protected"" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as ""open"" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true.", + SerializedName = @"subscriptionRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? ProductSubscriptionRequired { get; set; } + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false.", + SerializedName = @"subscriptionsLimit", + PossibleTypes = new [] { typeof(int) })] + int? ProductSubscriptionsLimit { get; set; } + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process.", + SerializedName = @"terms", + PossibleTypes = new [] { typeof(string) })] + string ProductTerm { get; set; } + /// Tag identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string TagId { get; set; } + /// Tag Name + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag Name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TagName { get; set; } + + } + /// TagResource contract properties. + internal partial interface ITagResourceContractInternal + + { + /// API associated with the tag. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IApiTagResourceContractProperties Api { get; set; } + /// Operation associated with the tag. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IOperationTagResourceContractProperties Operation { get; set; } + /// API Name. + string OperationApiName { get; set; } + /// API Revision. + string OperationApiRevision { get; set; } + /// API Version. + string OperationApiVersion { get; set; } + /// Operation Description. + string OperationDescription { get; set; } + /// Identifier of the operation in form /operations/{operationId}. + string OperationId { get; set; } + /// + /// A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. + /// + string OperationMethod { get; set; } + /// Operation name. + string OperationName { get; set; } + /// + /// Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} + /// + string OperationUrlTemplate { get; set; } + /// Product associated with the tag. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IProductTagResourceContractProperties Product { get; set; } + /// + /// whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers + /// to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription + /// before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and + /// has a value of false. + /// + bool? ProductApprovalRequired { get; set; } + /// Product description. May include HTML formatting tags. + string ProductDescription { get; set; } + /// Identifier of the product in the form of /products/{productId} + string ProductId { get; set; } + /// Product name. + string ProductName { get; set; } + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState? ProductState { get; set; } + /// + /// Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred + /// to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. + /// If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription + /// key. If property is omitted when creating a new product it's value is assumed to be true. + /// + bool? ProductSubscriptionRequired { get; set; } + /// + /// Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited + /// per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + /// + int? ProductSubscriptionsLimit { get; set; } + /// + /// Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms + /// before they can complete the subscription process. + /// + string ProductTerm { get; set; } + /// Tag associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractProperties Tag { get; set; } + /// Tag identifier + string TagId { get; set; } + /// Tag Name + string TagName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContract.json.cs new file mode 100644 index 000000000000..ca200da48929 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContract.json.cs @@ -0,0 +1,114 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// TagResource contract properties. + public partial class TagResourceContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagResourceContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagResourceContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tag = If( json?.PropertyT("tag"), out var __jsonTag) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TagResourceContractProperties.FromJson(__jsonTag) : Tag;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.OperationTagResourceContractProperties.FromJson(__jsonOperation) : Operation;} + {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ProductTagResourceContractProperties.FromJson(__jsonProduct) : Product;} + {_api = If( json?.PropertyT("api"), out var __jsonApi) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ApiTagResourceContractProperties.FromJson(__jsonApi) : Api;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tag" ,container.Add ); + AddIf( null != this._operation ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._operation.ToJson(null,serializationMode) : null, "operation" ,container.Add ); + AddIf( null != this._product ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._product.ToJson(null,serializationMode) : null, "product" ,container.Add ); + AddIf( null != this._api ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._api.ToJson(null,serializationMode) : null, "api" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContractProperties.cs new file mode 100644 index 000000000000..4806a18a8341 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContractProperties.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Contract defining the Tag property in the Tag Resource Contract + public partial class TagResourceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractPropertiesInternal + { + + /// Backing field for property. + private string _id; + + /// Tag identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _name; + + /// Tag Name + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public TagResourceContractProperties() + { + + } + } + /// Contract defining the Tag property in the Tag Resource Contract + public partial interface ITagResourceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Tag identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag identifier", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Tag Name + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag Name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Contract defining the Tag property in the Tag Resource Contract + internal partial interface ITagResourceContractPropertiesInternal + + { + /// Tag identifier + string Id { get; set; } + /// Tag Name + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContractProperties.json.cs new file mode 100644 index 000000000000..35e465598f02 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TagResourceContractProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Contract defining the Tag property in the Tag Resource Contract + public partial class TagResourceContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITagResourceContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagResourceContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagResourceContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContract.cs new file mode 100644 index 000000000000..6edee6815944 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContract.cs @@ -0,0 +1,227 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Result of Tenant Configuration Sync State. + public partial class TenantConfigurationSyncStateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// The name of Git branch. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Branch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).Branch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).Branch = value ?? null; } + + /// The latest commit Id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string CommitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).CommitId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).CommitId = value ?? null; } + + /// + /// The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? ConfigurationChangeDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).ConfigurationChangeDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).ConfigurationChangeDate = value ?? default(global::System.DateTime); } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// value indicating if last sync was save (true) or deploy (false) operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsExport { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).IsExport; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).IsExport = value ?? default(bool); } + + /// value indicating whether Git configuration access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsGitEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).IsGitEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).IsGitEnabled = value ?? default(bool); } + + /// + /// value indicating if last synchronization was later than the configuration change. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public bool? IsSynced { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).IsSynced; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).IsSynced = value ?? default(bool); } + + /// Most recent tenant configuration operation identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastOperationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).LastOperationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).LastOperationId = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantConfigurationSyncStateContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractProperties _property; + + /// Properties returned Tenant Configuration Sync State check. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantConfigurationSyncStateContractProperties()); set => this._property = value; } + + /// + /// The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? SyncDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).SyncDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal)Property).SyncDate = value ?? default(global::System.DateTime); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public TenantConfigurationSyncStateContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Result of Tenant Configuration Sync State. + public partial interface ITenantConfigurationSyncStateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// The name of Git branch. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of Git branch.", + SerializedName = @"branch", + PossibleTypes = new [] { typeof(string) })] + string Branch { get; set; } + /// The latest commit Id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The latest commit Id.", + SerializedName = @"commitId", + PossibleTypes = new [] { typeof(string) })] + string CommitId { get; set; } + /// + /// The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"configurationChangeDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ConfigurationChangeDate { get; set; } + /// value indicating if last sync was save (true) or deploy (false) operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"value indicating if last sync was save (true) or deploy (false) operation.", + SerializedName = @"isExport", + PossibleTypes = new [] { typeof(bool) })] + bool? IsExport { get; set; } + /// value indicating whether Git configuration access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"value indicating whether Git configuration access is enabled.", + SerializedName = @"isGitEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsGitEnabled { get; set; } + /// + /// value indicating if last synchronization was later than the configuration change. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"value indicating if last synchronization was later than the configuration change.", + SerializedName = @"isSynced", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSynced { get; set; } + /// Most recent tenant configuration operation identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Most recent tenant configuration operation identifier", + SerializedName = @"lastOperationId", + PossibleTypes = new [] { typeof(string) })] + string LastOperationId { get; set; } + /// + /// The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"syncDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SyncDate { get; set; } + + } + /// Result of Tenant Configuration Sync State. + internal partial interface ITenantConfigurationSyncStateContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// The name of Git branch. + string Branch { get; set; } + /// The latest commit Id. + string CommitId { get; set; } + /// + /// The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? ConfigurationChangeDate { get; set; } + /// value indicating if last sync was save (true) or deploy (false) operation. + bool? IsExport { get; set; } + /// value indicating whether Git configuration access is enabled. + bool? IsGitEnabled { get; set; } + /// + /// value indicating if last synchronization was later than the configuration change. + /// + bool? IsSynced { get; set; } + /// Most recent tenant configuration operation identifier + string LastOperationId { get; set; } + /// Properties returned Tenant Configuration Sync State check. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractProperties Property { get; set; } + /// + /// The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? SyncDate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContract.json.cs new file mode 100644 index 000000000000..3855b13f58bd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContract.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Result of Tenant Configuration Sync State. + public partial class TenantConfigurationSyncStateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TenantConfigurationSyncStateContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TenantConfigurationSyncStateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantConfigurationSyncStateContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContractProperties.cs new file mode 100644 index 000000000000..ab9ed77c55a3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContractProperties.cs @@ -0,0 +1,198 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant Configuration Synchronization State. + public partial class TenantConfigurationSyncStateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractPropertiesInternal + { + + /// Backing field for property. + private string _branch; + + /// The name of Git branch. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Branch { get => this._branch; set => this._branch = value; } + + /// Backing field for property. + private string _commitId; + + /// The latest commit Id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string CommitId { get => this._commitId; set => this._commitId = value; } + + /// Backing field for property. + private global::System.DateTime? _configurationChangeDate; + + /// + /// The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? ConfigurationChangeDate { get => this._configurationChangeDate; set => this._configurationChangeDate = value; } + + /// Backing field for property. + private bool? _isExport; + + /// value indicating if last sync was save (true) or deploy (false) operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsExport { get => this._isExport; set => this._isExport = value; } + + /// Backing field for property. + private bool? _isGitEnabled; + + /// value indicating whether Git configuration access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsGitEnabled { get => this._isGitEnabled; set => this._isGitEnabled = value; } + + /// Backing field for property. + private bool? _isSynced; + + /// + /// value indicating if last synchronization was later than the configuration change. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? IsSynced { get => this._isSynced; set => this._isSynced = value; } + + /// Backing field for property. + private string _lastOperationId; + + /// Most recent tenant configuration operation identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string LastOperationId { get => this._lastOperationId; set => this._lastOperationId = value; } + + /// Backing field for property. + private global::System.DateTime? _syncDate; + + /// + /// The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? SyncDate { get => this._syncDate; set => this._syncDate = value; } + + /// + /// Creates an new instance. + /// + public TenantConfigurationSyncStateContractProperties() + { + + } + } + /// Tenant Configuration Synchronization State. + public partial interface ITenantConfigurationSyncStateContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The name of Git branch. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of Git branch.", + SerializedName = @"branch", + PossibleTypes = new [] { typeof(string) })] + string Branch { get; set; } + /// The latest commit Id. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The latest commit Id.", + SerializedName = @"commitId", + PossibleTypes = new [] { typeof(string) })] + string CommitId { get; set; } + /// + /// The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"configurationChangeDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ConfigurationChangeDate { get; set; } + /// value indicating if last sync was save (true) or deploy (false) operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"value indicating if last sync was save (true) or deploy (false) operation.", + SerializedName = @"isExport", + PossibleTypes = new [] { typeof(bool) })] + bool? IsExport { get; set; } + /// value indicating whether Git configuration access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"value indicating whether Git configuration access is enabled.", + SerializedName = @"isGitEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsGitEnabled { get; set; } + /// + /// value indicating if last synchronization was later than the configuration change. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"value indicating if last synchronization was later than the configuration change.", + SerializedName = @"isSynced", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSynced { get; set; } + /// Most recent tenant configuration operation identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Most recent tenant configuration operation identifier", + SerializedName = @"lastOperationId", + PossibleTypes = new [] { typeof(string) })] + string LastOperationId { get; set; } + /// + /// The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"syncDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SyncDate { get; set; } + + } + /// Tenant Configuration Synchronization State. + internal partial interface ITenantConfigurationSyncStateContractPropertiesInternal + + { + /// The name of Git branch. + string Branch { get; set; } + /// The latest commit Id. + string CommitId { get; set; } + /// + /// The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? ConfigurationChangeDate { get; set; } + /// value indicating if last sync was save (true) or deploy (false) operation. + bool? IsExport { get; set; } + /// value indicating whether Git configuration access is enabled. + bool? IsGitEnabled { get; set; } + /// + /// value indicating if last synchronization was later than the configuration change. + /// + bool? IsSynced { get; set; } + /// Most recent tenant configuration operation identifier + string LastOperationId { get; set; } + /// + /// The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified + /// by the ISO 8601 standard. + /// + global::System.DateTime? SyncDate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContractProperties.json.cs new file mode 100644 index 000000000000..8ce00e56e0af --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantConfigurationSyncStateContractProperties.json.cs @@ -0,0 +1,125 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant Configuration Synchronization State. + public partial class TenantConfigurationSyncStateContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantConfigurationSyncStateContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TenantConfigurationSyncStateContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TenantConfigurationSyncStateContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_branch = If( json?.PropertyT("branch"), out var __jsonBranch) ? (string)__jsonBranch : (string)Branch;} + {_commitId = If( json?.PropertyT("commitId"), out var __jsonCommitId) ? (string)__jsonCommitId : (string)CommitId;} + {_isExport = If( json?.PropertyT("isExport"), out var __jsonIsExport) ? (bool?)__jsonIsExport : IsExport;} + {_isSynced = If( json?.PropertyT("isSynced"), out var __jsonIsSynced) ? (bool?)__jsonIsSynced : IsSynced;} + {_isGitEnabled = If( json?.PropertyT("isGitEnabled"), out var __jsonIsGitEnabled) ? (bool?)__jsonIsGitEnabled : IsGitEnabled;} + {_syncDate = If( json?.PropertyT("syncDate"), out var __jsonSyncDate) ? global::System.DateTime.TryParse((string)__jsonSyncDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSyncDateValue) ? __jsonSyncDateValue : SyncDate : SyncDate;} + {_configurationChangeDate = If( json?.PropertyT("configurationChangeDate"), out var __jsonConfigurationChangeDate) ? global::System.DateTime.TryParse((string)__jsonConfigurationChangeDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonConfigurationChangeDateValue) ? __jsonConfigurationChangeDateValue : ConfigurationChangeDate : ConfigurationChangeDate;} + {_lastOperationId = If( json?.PropertyT("lastOperationId"), out var __jsonLastOperationId) ? (string)__jsonLastOperationId : (string)LastOperationId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._branch)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._branch.ToString()) : null, "branch" ,container.Add ); + AddIf( null != (((object)this._commitId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._commitId.ToString()) : null, "commitId" ,container.Add ); + AddIf( null != this._isExport ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isExport) : null, "isExport" ,container.Add ); + AddIf( null != this._isSynced ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isSynced) : null, "isSynced" ,container.Add ); + AddIf( null != this._isGitEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._isGitEnabled) : null, "isGitEnabled" ,container.Add ); + AddIf( null != this._syncDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._syncDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "syncDate" ,container.Add ); + AddIf( null != this._configurationChangeDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._configurationChangeDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "configurationChangeDate" ,container.Add ); + AddIf( null != (((object)this._lastOperationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._lastOperationId.ToString()) : null, "lastOperationId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsCollection.cs new file mode 100644 index 000000000000..8a51344b3865 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsCollection.cs @@ -0,0 +1,74 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged AccessInformation list representation. + public partial class TenantSettingsCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract[] Value { get => this._value; } + + /// Creates an new instance. + public TenantSettingsCollection() + { + + } + } + /// Paged AccessInformation list representation. + public partial interface ITenantSettingsCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract[] Value { get; } + + } + /// Paged AccessInformation list representation. + internal partial interface ITenantSettingsCollectionInternal + + { + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsCollection.json.cs new file mode 100644 index 000000000000..3839c6efd84b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsCollection.json.cs @@ -0,0 +1,124 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged AccessInformation list representation. + public partial class TenantSettingsCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TenantSettingsCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TenantSettingsCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantSettingsContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContract.cs new file mode 100644 index 000000000000..0a675bfa374e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContract.cs @@ -0,0 +1,127 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant Settings. + public partial class TenantSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantSettingsContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractProperties _property; + + /// TenantSettings entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantSettingsContractProperties()); set => this._property = value; } + + /// Tenant settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings Setting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesInternal)Property).Setting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesInternal)Property).Setting = value ?? null /* model class */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public TenantSettingsContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Tenant Settings. + public partial interface ITenantSettingsContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Tenant settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant settings", + SerializedName = @"settings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings Setting { get; set; } + + } + /// Tenant Settings. + internal partial interface ITenantSettingsContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// TenantSettings entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractProperties Property { get; set; } + /// Tenant settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings Setting { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContract.json.cs new file mode 100644 index 000000000000..b2e78c528470 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant Settings. + public partial class TenantSettingsContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TenantSettingsContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TenantSettingsContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantSettingsContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractProperties.cs new file mode 100644 index 000000000000..487a70d2ffc2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information contract of the API Management service. + public partial class TenantSettingsContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings _setting; + + /// Tenant settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantSettingsContractPropertiesSettings()); set => this._setting = value; } + + /// Creates an new instance. + public TenantSettingsContractProperties() + { + + } + } + /// Tenant access information contract of the API Management service. + public partial interface ITenantSettingsContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Tenant settings + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant settings", + SerializedName = @"settings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings Setting { get; set; } + + } + /// Tenant access information contract of the API Management service. + internal partial interface ITenantSettingsContractPropertiesInternal + + { + /// Tenant settings + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings Setting { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractProperties.json.cs new file mode 100644 index 000000000000..e1462221103f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractProperties.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant access information contract of the API Management service. + public partial class TenantSettingsContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TenantSettingsContractProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TenantSettingsContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_setting = If( json?.PropertyT("settings"), out var __jsonSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantSettingsContractPropertiesSettings.FromJson(__jsonSettings) : Setting;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._setting ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._setting.ToJson(null,serializationMode) : null, "settings" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractPropertiesSettings.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractPropertiesSettings.cs new file mode 100644 index 000000000000..ec9d210fa628 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractPropertiesSettings.cs @@ -0,0 +1,37 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant settings + public partial class TenantSettingsContractPropertiesSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettingsInternal + { + + /// + /// Creates an new instance. + /// + public TenantSettingsContractPropertiesSettings() + { + + } + } + /// Tenant settings + public partial interface ITenantSettingsContractPropertiesSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// Tenant settings + internal partial interface ITenantSettingsContractPropertiesSettingsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractPropertiesSettings.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractPropertiesSettings.dictionary.cs new file mode 100644 index 000000000000..b721d1e92f98 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractPropertiesSettings.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TenantSettingsContractPropertiesSettings : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.TenantSettingsContractPropertiesSettings source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractPropertiesSettings.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractPropertiesSettings.json.cs new file mode 100644 index 000000000000..44a9d6ab95d7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TenantSettingsContractPropertiesSettings.json.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Tenant settings + public partial class TenantSettingsContractPropertiesSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITenantSettingsContractPropertiesSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TenantSettingsContractPropertiesSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TenantSettingsContractPropertiesSettings(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TermsOfServiceProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TermsOfServiceProperties.cs new file mode 100644 index 000000000000..1bac47ea8715 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TermsOfServiceProperties.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Terms of service contract properties. + public partial class TermsOfServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServicePropertiesInternal + { + + /// Backing field for property. + private bool? _consentRequired; + + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? ConsentRequired { get => this._consentRequired; set => this._consentRequired = value; } + + /// Backing field for property. + private bool? _enabled; + + /// Display terms of service during a sign-up process. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private string _text; + + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Text { get => this._text; set => this._text = value; } + + /// Creates an new instance. + public TermsOfServiceProperties() + { + + } + } + /// Terms of service contract properties. + public partial interface ITermsOfServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Ask user for consent to the terms of service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ask user for consent to the terms of service.", + SerializedName = @"consentRequired", + PossibleTypes = new [] { typeof(bool) })] + bool? ConsentRequired { get; set; } + /// Display terms of service during a sign-up process. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display terms of service during a sign-up process.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// A terms of service text. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A terms of service text.", + SerializedName = @"text", + PossibleTypes = new [] { typeof(string) })] + string Text { get; set; } + + } + /// Terms of service contract properties. + internal partial interface ITermsOfServicePropertiesInternal + + { + /// Ask user for consent to the terms of service. + bool? ConsentRequired { get; set; } + /// Display terms of service during a sign-up process. + bool? Enabled { get; set; } + /// A terms of service text. + string Text { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TermsOfServiceProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TermsOfServiceProperties.json.cs new file mode 100644 index 000000000000..f81c9bc37208 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TermsOfServiceProperties.json.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Terms of service contract properties. + public partial class TermsOfServiceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITermsOfServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TermsOfServiceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TermsOfServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_text = If( json?.PropertyT("text"), out var __jsonText) ? (string)__jsonText : (string)Text;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_consentRequired = If( json?.PropertyT("consentRequired"), out var __jsonConsentRequired) ? (bool?)__jsonConsentRequired : ConsentRequired;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._text)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._text.ToString()) : null, "text" ,container.Add ); + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != this._consentRequired ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonBoolean((bool)this._consentRequired) : null, "consentRequired" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TokenBodyParameterContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TokenBodyParameterContract.cs new file mode 100644 index 000000000000..1354552edab8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TokenBodyParameterContract.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth acquire token request body parameter (www-url-form-encoded). + public partial class TokenBodyParameterContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContractInternal + { + + /// Backing field for property. + private string _name; + + /// body parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _value; + + /// body parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TokenBodyParameterContract() + { + + } + } + /// OAuth acquire token request body parameter (www-url-form-encoded). + public partial interface ITokenBodyParameterContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// body parameter name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"body parameter name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// body parameter value. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"body parameter value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// OAuth acquire token request body parameter (www-url-form-encoded). + internal partial interface ITokenBodyParameterContractInternal + + { + /// body parameter name. + string Name { get; set; } + /// body parameter value. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TokenBodyParameterContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TokenBodyParameterContract.json.cs new file mode 100644 index 000000000000..294cb73fa865 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/TokenBodyParameterContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// OAuth acquire token request body parameter (www-url-form-encoded). + public partial class TokenBodyParameterContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.ITokenBodyParameterContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TokenBodyParameterContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TokenBodyParameterContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCollection.cs new file mode 100644 index 000000000000..b5642bf36832 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Users list representation. + public partial class UserCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public UserCollection() + { + + } + } + /// Paged Users list representation. + public partial interface IUserCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContract[] Value { get; set; } + + } + /// Paged Users list representation. + internal partial interface IUserCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCollection.json.cs new file mode 100644 index 000000000000..1fbc4fe1adf6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Users list representation. + public partial class UserCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContract.cs new file mode 100644 index 000000000000..28a6c0c3e463 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContract.cs @@ -0,0 +1,247 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User details. + public partial class UserContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Email address. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Email { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).Email = value ?? null; } + + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string FirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).FirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).FirstName = value ?? null; } + + /// Collection of groups user is part of. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties[] Group { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).Group; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Identity = value ?? null /* arrayOf */; } + + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).LastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).LastName = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Group + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractInternal.Group { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).Group; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).Group = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Note { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Note = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractProperties _property; + + /// User entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContractProperties()); set => this._property = value; } + + /// + /// Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + /// standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? RegistrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).RegistrationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal)Property).RegistrationDate = value ?? default(global::System.DateTime); } + + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public UserContract() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// User details. + public partial interface IUserContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Email address. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email address.", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string Email { get; set; } + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"First name.", + SerializedName = @"firstName", + PossibleTypes = new [] { typeof(string) })] + string FirstName { get; set; } + /// Collection of groups user is part of. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Collection of groups user is part of.", + SerializedName = @"groups", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties[] Group { get; } + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of user identities.", + SerializedName = @"identities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get; set; } + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last name.", + SerializedName = @"lastName", + PossibleTypes = new [] { typeof(string) })] + string LastName { get; set; } + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional note about a user set by the administrator.", + SerializedName = @"note", + PossibleTypes = new [] { typeof(string) })] + string Note { get; set; } + /// + /// Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + /// standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"registrationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RegistrationDate { get; set; } + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get; set; } + + } + /// User details. + internal partial interface IUserContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + string ETag { get; set; } + /// Email address. + string Email { get; set; } + /// First name. + string FirstName { get; set; } + /// Collection of groups user is part of. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties[] Group { get; set; } + /// Collection of user identities. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get; set; } + /// Last name. + string LastName { get; set; } + /// Optional note about a user set by the administrator. + string Note { get; set; } + /// User entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractProperties Property { get; set; } + /// + /// Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + /// standard. + /// + global::System.DateTime? RegistrationDate { get; set; } + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContract.json.cs new file mode 100644 index 000000000000..4b861a17bcc5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User details. + public partial class UserContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContractProperties.cs new file mode 100644 index 000000000000..2edd7a594837 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContractProperties.cs @@ -0,0 +1,166 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User profile. + public partial class UserContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParameters __userEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserEntityBaseParameters(); + + /// Backing field for property. + private string _email; + + /// Email address. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Email { get => this._email; set => this._email = value; } + + /// Backing field for property. + private string _firstName; + + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string FirstName { get => this._firstName; set => this._firstName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties[] _group; + + /// Collection of groups user is part of. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties[] Group { get => this._group; } + + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Identity = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _lastName; + + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string LastName { get => this._lastName; set => this._lastName = value; } + + /// Internal Acessors for Group + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractPropertiesInternal.Group { get => this._group; set { {_group = value;} } } + + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Note { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Note = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _registrationDate; + + /// + /// Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + /// standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? RegistrationDate { get => this._registrationDate; set => this._registrationDate = value; } + + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState)""); } + + /// Creates an new instance. + public UserContractProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__userEntityBaseParameters), __userEntityBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__userEntityBaseParameters), __userEntityBaseParameters); + } + } + /// User profile. + public partial interface IUserContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParameters + { + /// Email address. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email address.", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string Email { get; set; } + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"First name.", + SerializedName = @"firstName", + PossibleTypes = new [] { typeof(string) })] + string FirstName { get; set; } + /// Collection of groups user is part of. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Collection of groups user is part of.", + SerializedName = @"groups", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties[] Group { get; } + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last name.", + SerializedName = @"lastName", + PossibleTypes = new [] { typeof(string) })] + string LastName { get; set; } + /// + /// Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + /// standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"registrationDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RegistrationDate { get; set; } + + } + /// User profile. + internal partial interface IUserContractPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal + { + /// Email address. + string Email { get; set; } + /// First name. + string FirstName { get; set; } + /// Collection of groups user is part of. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties[] Group { get; set; } + /// Last name. + string LastName { get; set; } + /// + /// Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + /// standard. + /// + global::System.DateTime? RegistrationDate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContractProperties.json.cs new file mode 100644 index 000000000000..f97f6bfda75f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserContractProperties.json.cs @@ -0,0 +1,129 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User profile. + public partial class UserContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __userEntityBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._firstName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._firstName.ToString()) : null, "firstName" ,container.Add ); + AddIf( null != (((object)this._lastName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._lastName.ToString()) : null, "lastName" ,container.Add ); + AddIf( null != (((object)this._email)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._email.ToString()) : null, "email" ,container.Add ); + AddIf( null != this._registrationDate ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._registrationDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "registrationDate" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._group) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._group ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("groups",__w); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __userEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserEntityBaseParameters(json); + {_firstName = If( json?.PropertyT("firstName"), out var __jsonFirstName) ? (string)__jsonFirstName : (string)FirstName;} + {_lastName = If( json?.PropertyT("lastName"), out var __jsonLastName) ? (string)__jsonLastName : (string)LastName;} + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} + {_registrationDate = If( json?.PropertyT("registrationDate"), out var __jsonRegistrationDate) ? global::System.DateTime.TryParse((string)__jsonRegistrationDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRegistrationDateValue) ? __jsonRegistrationDateValue : RegistrationDate : RegistrationDate;} + {_group = If( json?.PropertyT("groups"), out var __jsonGroups) ? If( __jsonGroups as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IGroupContractProperties) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.GroupContractProperties.FromJson(__u) )) ))() : null : Group;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameterProperties.cs new file mode 100644 index 000000000000..2105a2102602 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameterProperties.cs @@ -0,0 +1,188 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create User operation. + public partial class UserCreateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParameters __userEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserEntityBaseParameters(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? _appType; + + /// + /// Determines the type of application which send the create user request. Default is legacy portal. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? AppType { get => this._appType; set => this._appType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation? _confirmation; + + /// + /// Determines the type of confirmation e-mail that will be sent to the newly created user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation? Confirmation { get => this._confirmation; set => this._confirmation = value; } + + /// Backing field for property. + private string _email; + + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Email { get => this._email; set => this._email = value; } + + /// Backing field for property. + private string _firstName; + + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string FirstName { get => this._firstName; set => this._firstName = value; } + + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Identity = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _lastName; + + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string LastName { get => this._lastName; set => this._lastName = value; } + + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Note { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Note = value ?? null; } + + /// Backing field for property. + private string _password; + + /// User Password. If no value is provided, a default password is generated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Password { get => this._password; set => this._password = value; } + + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState)""); } + + /// Creates an new instance. + public UserCreateParameterProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__userEntityBaseParameters), __userEntityBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__userEntityBaseParameters), __userEntityBaseParameters); + } + } + /// Parameters supplied to the Create User operation. + public partial interface IUserCreateParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParameters + { + /// + /// Determines the type of application which send the create user request. Default is legacy portal. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines the type of application which send the create user request. Default is legacy portal.", + SerializedName = @"appType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? AppType { get; set; } + /// + /// Determines the type of confirmation e-mail that will be sent to the newly created user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines the type of confirmation e-mail that will be sent to the newly created user.", + SerializedName = @"confirmation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation? Confirmation { get; set; } + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Email address. Must not be empty and must be unique within the service instance.", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string Email { get; set; } + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"First name.", + SerializedName = @"firstName", + PossibleTypes = new [] { typeof(string) })] + string FirstName { get; set; } + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Last name.", + SerializedName = @"lastName", + PossibleTypes = new [] { typeof(string) })] + string LastName { get; set; } + /// User Password. If no value is provided, a default password is generated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User Password. If no value is provided, a default password is generated.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string Password { get; set; } + + } + /// Parameters supplied to the Create User operation. + internal partial interface IUserCreateParameterPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal + { + /// + /// Determines the type of application which send the create user request. Default is legacy portal. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? AppType { get; set; } + /// + /// Determines the type of confirmation e-mail that will be sent to the newly created user. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation? Confirmation { get; set; } + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + string Email { get; set; } + /// First name. + string FirstName { get; set; } + /// Last name. + string LastName { get; set; } + /// User Password. If no value is provided, a default password is generated. + string Password { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameterProperties.json.cs new file mode 100644 index 000000000000..897de8f789cd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameterProperties.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Create User operation. + public partial class UserCreateParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserCreateParameterProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __userEntityBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._email)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._email.ToString()) : null, "email" ,container.Add ); + AddIf( null != (((object)this._firstName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._firstName.ToString()) : null, "firstName" ,container.Add ); + AddIf( null != (((object)this._lastName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._lastName.ToString()) : null, "lastName" ,container.Add ); + AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._password.ToString()) : null, "password" ,container.Add ); + AddIf( null != (((object)this._appType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._appType.ToString()) : null, "appType" ,container.Add ); + AddIf( null != (((object)this._confirmation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._confirmation.ToString()) : null, "confirmation" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserCreateParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __userEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserEntityBaseParameters(json); + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} + {_firstName = If( json?.PropertyT("firstName"), out var __jsonFirstName) ? (string)__jsonFirstName : (string)FirstName;} + {_lastName = If( json?.PropertyT("lastName"), out var __jsonLastName) ? (string)__jsonLastName : (string)LastName;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} + {_appType = If( json?.PropertyT("appType"), out var __jsonAppType) ? (string)__jsonAppType : (string)AppType;} + {_confirmation = If( json?.PropertyT("confirmation"), out var __jsonConfirmation) ? (string)__jsonConfirmation : (string)Confirmation;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameters.cs new file mode 100644 index 000000000000..55e93fed6ee8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameters.cs @@ -0,0 +1,199 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User create details. + public partial class UserCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParametersInternal + { + + /// + /// Determines the type of application which send the create user request. Default is legacy portal. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? AppType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).AppType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).AppType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType)""); } + + /// + /// Determines the type of confirmation e-mail that will be sent to the newly created user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation? Confirmation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).Confirmation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).Confirmation = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation)""); } + + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Email { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).Email = value ?? null; } + + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string FirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).FirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).FirstName = value ?? null; } + + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Identity = value ?? null /* arrayOf */; } + + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).LastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).LastName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserCreateParameterProperties()); set { {_property = value;} } } + + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Note { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Note = value ?? null; } + + /// User Password. If no value is provided, a default password is generated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterPropertiesInternal)Property).Password = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterProperties _property; + + /// User entity create contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserCreateParameterProperties()); set => this._property = value; } + + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState)""); } + + /// Creates an new instance. + public UserCreateParameters() + { + + } + } + /// User create details. + public partial interface IUserCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Determines the type of application which send the create user request. Default is legacy portal. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines the type of application which send the create user request. Default is legacy portal.", + SerializedName = @"appType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? AppType { get; set; } + /// + /// Determines the type of confirmation e-mail that will be sent to the newly created user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines the type of confirmation e-mail that will be sent to the newly created user.", + SerializedName = @"confirmation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation? Confirmation { get; set; } + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email address. Must not be empty and must be unique within the service instance.", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string Email { get; set; } + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"First name.", + SerializedName = @"firstName", + PossibleTypes = new [] { typeof(string) })] + string FirstName { get; set; } + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of user identities.", + SerializedName = @"identities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get; set; } + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last name.", + SerializedName = @"lastName", + PossibleTypes = new [] { typeof(string) })] + string LastName { get; set; } + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional note about a user set by the administrator.", + SerializedName = @"note", + PossibleTypes = new [] { typeof(string) })] + string Note { get; set; } + /// User Password. If no value is provided, a default password is generated. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User Password. If no value is provided, a default password is generated.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string Password { get; set; } + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get; set; } + + } + /// User create details. + internal partial interface IUserCreateParametersInternal + + { + /// + /// Determines the type of application which send the create user request. Default is legacy portal. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType? AppType { get; set; } + /// + /// Determines the type of confirmation e-mail that will be sent to the newly created user. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation? Confirmation { get; set; } + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + string Email { get; set; } + /// First name. + string FirstName { get; set; } + /// Collection of user identities. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get; set; } + /// Last name. + string LastName { get; set; } + /// Optional note about a user set by the administrator. + string Note { get; set; } + /// User Password. If no value is provided, a default password is generated. + string Password { get; set; } + /// User entity create contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameterProperties Property { get; set; } + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameters.json.cs new file mode 100644 index 000000000000..5f5deb951c5a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserCreateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User create details. + public partial class UserCreateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserCreateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserCreateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserCreateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserCreateParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserEntityBaseParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserEntityBaseParameters.cs new file mode 100644 index 000000000000..46b393f146d6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserEntityBaseParameters.cs @@ -0,0 +1,94 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User Entity Base Parameters set. + public partial class UserEntityBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] _identity; + + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get => this._identity; set => this._identity = value; } + + /// Backing field for property. + private string _note; + + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Note { get => this._note; set => this._note = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? _state; + + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get => this._state; set => this._state = value; } + + /// Creates an new instance. + public UserEntityBaseParameters() + { + + } + } + /// User Entity Base Parameters set. + public partial interface IUserEntityBaseParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of user identities.", + SerializedName = @"identities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get; set; } + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional note about a user set by the administrator.", + SerializedName = @"note", + PossibleTypes = new [] { typeof(string) })] + string Note { get; set; } + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get; set; } + + } + /// User Entity Base Parameters set. + internal partial interface IUserEntityBaseParametersInternal + + { + /// Collection of user identities. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get; set; } + /// Optional note about a user set by the administrator. + string Note { get; set; } + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserEntityBaseParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserEntityBaseParameters.json.cs new file mode 100644 index 000000000000..cf465703512d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserEntityBaseParameters.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User Entity Base Parameters set. + public partial class UserEntityBaseParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserEntityBaseParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AddIf( null != (((object)this._note)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._note.ToString()) : null, "note" ,container.Add ); + if (null != this._identity) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._identity ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("identities",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserEntityBaseParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_note = If( json?.PropertyT("note"), out var __jsonNote) ? (string)__jsonNote : (string)Note;} + {_identity = If( json?.PropertyT("identities"), out var __jsonIdentities) ? If( __jsonIdentities as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserIdentityContract.FromJson(__u) )) ))() : null : Identity;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityCollection.cs new file mode 100644 index 000000000000..7b633384b03e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// List of Users Identity list representation. + public partial class UserIdentityCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] _value; + + /// User Identity values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public UserIdentityCollection() + { + + } + } + /// List of Users Identity list representation. + public partial interface IUserIdentityCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// User Identity values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User Identity values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Value { get; set; } + + } + /// List of Users Identity list representation. + internal partial interface IUserIdentityCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// User Identity values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityCollection.json.cs new file mode 100644 index 000000000000..249a426c4130 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// List of Users Identity list representation. + public partial class UserIdentityCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserIdentityCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserIdentityCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserIdentityContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityContract.cs new file mode 100644 index 000000000000..45fb19bcf12a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityContract.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User identity details. + public partial class UserIdentityContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContractInternal + { + + /// Backing field for property. + private string _id; + + /// Identifier value within provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _provider; + + /// Identity provider name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Creates an new instance. + public UserIdentityContract() + { + + } + } + /// User identity details. + public partial interface IUserIdentityContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Identifier value within provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier value within provider.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Identity provider name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity provider name.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + + } + /// User identity details. + internal partial interface IUserIdentityContractInternal + + { + /// Identifier value within provider. + string Id { get; set; } + /// Identity provider name. + string Provider { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityContract.json.cs new file mode 100644 index 000000000000..e22def0abc85 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User identity details. + public partial class UserIdentityContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserIdentityContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserIdentityContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityProperties.cs new file mode 100644 index 000000000000..6eab2b93c562 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityProperties.cs @@ -0,0 +1,65 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class UserIdentityProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityPropertiesInternal + { + + /// Backing field for property. + private string _clientId; + + /// The client id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// Backing field for property. + private string _principalId; + + /// The principal id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; set => this._principalId = value; } + + /// Creates an new instance. + public UserIdentityProperties() + { + + } + } + public partial interface IUserIdentityProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The client id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client id of user assigned identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// The principal id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal id of user assigned identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; set; } + + } + internal partial interface IUserIdentityPropertiesInternal + + { + /// The client id of user assigned identity. + string ClientId { get; set; } + /// The principal id of user assigned identity. + string PrincipalId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityProperties.json.cs new file mode 100644 index 000000000000..f087e38bda7d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserIdentityProperties.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class UserIdentityProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserIdentityProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserIdentityProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameterProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameterProperties.cs new file mode 100644 index 000000000000..03d4c55fbd10 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameterProperties.cs @@ -0,0 +1,78 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Get User Token operation. + public partial class UserTokenParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime _expiry; + + /// + /// The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: + /// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime Expiry { get => this._expiry; set => this._expiry = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType _keyType; + + /// The Key to be used to generate token for user. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType KeyType { get => this._keyType; set => this._keyType = value; } + + /// Creates an new instance. + public UserTokenParameterProperties() + { + + } + } + /// Parameters supplied to the Get User Token operation. + public partial interface IUserTokenParameterProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: + /// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"expiry", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime Expiry { get; set; } + /// The Key to be used to generate token for user. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Key to be used to generate token for user.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType KeyType { get; set; } + + } + /// Parameters supplied to the Get User Token operation. + internal partial interface IUserTokenParameterPropertiesInternal + + { + /// + /// The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: + /// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + global::System.DateTime Expiry { get; set; } + /// The Key to be used to generate token for user. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType KeyType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameterProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameterProperties.json.cs new file mode 100644 index 000000000000..a7e4eedc9ee5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameterProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Get User Token operation. + public partial class UserTokenParameterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserTokenParameterProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._keyType.ToString()) : null, "keyType" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._expiry.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "expiry" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserTokenParameterProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyType = If( json?.PropertyT("keyType"), out var __jsonKeyType) ? (string)__jsonKeyType : (string)KeyType;} + {_expiry = If( json?.PropertyT("expiry"), out var __jsonExpiry) ? global::System.DateTime.TryParse((string)__jsonExpiry, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryValue) ? __jsonExpiryValue : Expiry : Expiry;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameters.cs new file mode 100644 index 000000000000..9fc587ce6663 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameters.cs @@ -0,0 +1,84 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Get User Token parameters. + public partial class UserTokenParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParametersInternal + { + + /// + /// The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: + /// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public global::System.DateTime? Expiry { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterPropertiesInternal)Property).Expiry; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterPropertiesInternal)Property).Expiry = value ?? default(global::System.DateTime); } + + /// The Key to be used to generate token for user. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType? KeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterPropertiesInternal)Property).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterPropertiesInternal)Property).KeyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType)""); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserTokenParameterProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterProperties _property; + + /// User Token Parameter contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserTokenParameterProperties()); set => this._property = value; } + + /// Creates an new instance. + public UserTokenParameters() + { + + } + } + /// Get User Token parameters. + public partial interface IUserTokenParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: + /// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ", + SerializedName = @"expiry", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Expiry { get; set; } + /// The Key to be used to generate token for user. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Key to be used to generate token for user.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType? KeyType { get; set; } + + } + /// Get User Token parameters. + internal partial interface IUserTokenParametersInternal + + { + /// + /// The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: + /// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + /// + global::System.DateTime? Expiry { get; set; } + /// The Key to be used to generate token for user. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType? KeyType { get; set; } + /// User Token Parameter contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameterProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameters.json.cs new file mode 100644 index 000000000000..3d75855aaaf8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Get User Token parameters. + public partial class UserTokenParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserTokenParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserTokenParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserTokenParameterProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenResult.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenResult.cs new file mode 100644 index 000000000000..53207edfffb4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenResult.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Get User Token response details. + public partial class UserTokenResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenResult, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenResultInternal + { + + /// Backing field for property. + private string _value; + + /// Shared Access Authorization token for the User. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public UserTokenResult() + { + + } + } + /// Get User Token response details. + public partial interface IUserTokenResult : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Shared Access Authorization token for the User. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Shared Access Authorization token for the User.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Get User Token response details. + internal partial interface IUserTokenResultInternal + + { + /// Shared Access Authorization token for the User. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenResult.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenResult.json.cs new file mode 100644 index 000000000000..48167bb34e5a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserTokenResult.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Get User Token response details. + public partial class UserTokenResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserTokenResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserTokenResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserTokenResult(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParameters.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParameters.cs new file mode 100644 index 000000000000..eeebd36cc5c9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParameters.cs @@ -0,0 +1,159 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User update parameters. + public partial class UserUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersInternal + { + + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Email { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersPropertiesInternal)Property).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersPropertiesInternal)Property).Email = value ?? null; } + + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string FirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersPropertiesInternal)Property).FirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersPropertiesInternal)Property).FirstName = value ?? null; } + + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Identity = value ?? null /* arrayOf */; } + + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string LastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersPropertiesInternal)Property).LastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersPropertiesInternal)Property).LastName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserUpdateParametersProperties()); set { {_property = value;} } } + + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Note { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).Note = value ?? null; } + + /// User Password. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersPropertiesInternal)Property).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersPropertiesInternal)Property).Password = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersProperties _property; + + /// User entity update contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserUpdateParametersProperties()); set => this._property = value; } + + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState)""); } + + /// Creates an new instance. + public UserUpdateParameters() + { + + } + } + /// User update parameters. + public partial interface IUserUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email address. Must not be empty and must be unique within the service instance.", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string Email { get; set; } + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"First name.", + SerializedName = @"firstName", + PossibleTypes = new [] { typeof(string) })] + string FirstName { get; set; } + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection of user identities.", + SerializedName = @"identities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get; set; } + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last name.", + SerializedName = @"lastName", + PossibleTypes = new [] { typeof(string) })] + string LastName { get; set; } + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional note about a user set by the administrator.", + SerializedName = @"note", + PossibleTypes = new [] { typeof(string) })] + string Note { get; set; } + /// User Password. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User Password.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string Password { get; set; } + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get; set; } + + } + /// User update parameters. + internal partial interface IUserUpdateParametersInternal + + { + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + string Email { get; set; } + /// First name. + string FirstName { get; set; } + /// Collection of user identities. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get; set; } + /// Last name. + string LastName { get; set; } + /// Optional note about a user set by the administrator. + string Note { get; set; } + /// User Password. + string Password { get; set; } + /// User entity update contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersProperties Property { get; set; } + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParameters.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParameters.json.cs new file mode 100644 index 000000000000..c2a81c190a27 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParameters.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// User update parameters. + public partial class UserUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserUpdateParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserUpdateParametersProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParametersProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParametersProperties.cs new file mode 100644 index 000000000000..e5d52f363d10 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParametersProperties.cs @@ -0,0 +1,142 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update User operation. + public partial class UserUpdateParametersProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParameters __userEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserEntityBaseParameters(); + + /// Backing field for property. + private string _email; + + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Email { get => this._email; set => this._email = value; } + + /// Backing field for property. + private string _firstName; + + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string FirstName { get => this._firstName; set => this._firstName = value; } + + /// Collection of user identities. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserIdentityContract[] Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Identity = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _lastName; + + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string LastName { get => this._lastName; set => this._lastName = value; } + + /// Optional note about a user set by the administrator. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Note { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Note; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).Note = value ?? null; } + + /// Backing field for property. + private string _password; + + /// User Password. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Password { get => this._password; set => this._password = value; } + + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal)__userEntityBaseParameters).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState)""); } + + /// Creates an new instance. + public UserUpdateParametersProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__userEntityBaseParameters), __userEntityBaseParameters); + await eventListener.AssertObjectIsValid(nameof(__userEntityBaseParameters), __userEntityBaseParameters); + } + } + /// Parameters supplied to the Update User operation. + public partial interface IUserUpdateParametersProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParameters + { + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email address. Must not be empty and must be unique within the service instance.", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string Email { get; set; } + /// First name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"First name.", + SerializedName = @"firstName", + PossibleTypes = new [] { typeof(string) })] + string FirstName { get; set; } + /// Last name. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Last name.", + SerializedName = @"lastName", + PossibleTypes = new [] { typeof(string) })] + string LastName { get; set; } + /// User Password. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User Password.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(string) })] + string Password { get; set; } + + } + /// Parameters supplied to the Update User operation. + internal partial interface IUserUpdateParametersPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserEntityBaseParametersInternal + { + /// + /// Email address. Must not be empty and must be unique within the service instance. + /// + string Email { get; set; } + /// First name. + string FirstName { get; set; } + /// Last name. + string LastName { get; set; } + /// User Password. + string Password { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParametersProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParametersProperties.json.cs new file mode 100644 index 000000000000..ef8e12966e53 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/UserUpdateParametersProperties.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Parameters supplied to the Update User operation. + public partial class UserUpdateParametersProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IUserUpdateParametersProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserUpdateParametersProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __userEntityBaseParameters?.ToJson(container, serializationMode); + AddIf( null != (((object)this._email)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._email.ToString()) : null, "email" ,container.Add ); + AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._password.ToString()) : null, "password" ,container.Add ); + AddIf( null != (((object)this._firstName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._firstName.ToString()) : null, "firstName" ,container.Add ); + AddIf( null != (((object)this._lastName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._lastName.ToString()) : null, "lastName" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserUpdateParametersProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __userEntityBaseParameters = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.UserEntityBaseParameters(json); + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} + {_firstName = If( json?.PropertyT("firstName"), out var __jsonFirstName) ? (string)__jsonFirstName : (string)FirstName;} + {_lastName = If( json?.PropertyT("lastName"), out var __jsonLastName) ? (string)__jsonLastName : (string)LastName;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/VirtualNetworkConfiguration.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/VirtualNetworkConfiguration.cs new file mode 100644 index 000000000000..9fb8f35c354c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/VirtualNetworkConfiguration.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Configuration of a virtual network to which API Management service is deployed. + public partial class VirtualNetworkConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal + { + + /// Internal Acessors for Subnetname + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal.Subnetname { get => this._subnetname; set { {_subnetname = value;} } } + + /// Internal Acessors for Vnetid + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfigurationInternal.Vnetid { get => this._vnetid; set { {_vnetid = value;} } } + + /// Backing field for property. + private string _subnetResourceId; + + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SubnetResourceId { get => this._subnetResourceId; set => this._subnetResourceId = value; } + + /// Backing field for property. + private string _subnetname; + + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Subnetname { get => this._subnetname; } + + /// Backing field for property. + private string _vnetid; + + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Vnetid { get => this._vnetid; } + + /// Creates an new instance. + public VirtualNetworkConfiguration() + { + + } + } + /// Configuration of a virtual network to which API Management service is deployed. + public partial interface IVirtualNetworkConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full resource ID of a subnet in a virtual network to deploy the API Management service in.", + SerializedName = @"subnetResourceId", + PossibleTypes = new [] { typeof(string) })] + string SubnetResourceId { get; set; } + /// The name of the subnet. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the subnet.", + SerializedName = @"subnetname", + PossibleTypes = new [] { typeof(string) })] + string Subnetname { get; } + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The virtual network ID. This is typically a GUID. Expect a null GUID by default.", + SerializedName = @"vnetid", + PossibleTypes = new [] { typeof(string) })] + string Vnetid { get; } + + } + /// Configuration of a virtual network to which API Management service is deployed. + internal partial interface IVirtualNetworkConfigurationInternal + + { + /// + /// The full resource ID of a subnet in a virtual network to deploy the API Management service in. + /// + string SubnetResourceId { get; set; } + /// The name of the subnet. + string Subnetname { get; set; } + /// + /// The virtual network ID. This is typically a GUID. Expect a null GUID by default. + /// + string Vnetid { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/VirtualNetworkConfiguration.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/VirtualNetworkConfiguration.json.cs new file mode 100644 index 000000000000..115beaca4bd0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/VirtualNetworkConfiguration.json.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Configuration of a virtual network to which API Management service is deployed. + public partial class VirtualNetworkConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IVirtualNetworkConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new VirtualNetworkConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._vnetid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._vnetid.ToString()) : null, "vnetid" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subnetname)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._subnetname.ToString()) : null, "subnetname" ,container.Add ); + } + AddIf( null != (((object)this._subnetResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._subnetResourceId.ToString()) : null, "subnetResourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal VirtualNetworkConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_vnetid = If( json?.PropertyT("vnetid"), out var __jsonVnetid) ? (string)__jsonVnetid : (string)Vnetid;} + {_subnetname = If( json?.PropertyT("subnetname"), out var __jsonSubnetname) ? (string)__jsonSubnetname : (string)Subnetname;} + {_subnetResourceId = If( json?.PropertyT("subnetResourceId"), out var __jsonSubnetResourceId) ? (string)__jsonSubnetResourceId : (string)SubnetResourceId;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiCollection.cs new file mode 100644 index 000000000000..978643684d79 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiCollection.cs @@ -0,0 +1,98 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Wiki list representation. + public partial class WikiCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiCollectionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract[] Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiCollectionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract[] Value { get => this._value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiCollectionInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public WikiCollection() + { + + } + } + /// Paged Wiki list representation. + public partial interface IWikiCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract[] Value { get; } + + } + /// Paged Wiki list representation. + internal partial interface IWikiCollectionInternal + + { + string ETag { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiCollection.json.cs new file mode 100644 index 000000000000..f7b09037aec7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiCollection.json.cs @@ -0,0 +1,124 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged Wiki list representation. + public partial class WikiCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WikiCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WikiCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContract.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContract.cs new file mode 100644 index 000000000000..dd9d4f32064c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContract.cs @@ -0,0 +1,129 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki properties + public partial class WikiContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Collection wiki documents included into this wiki. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract[] Document { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractPropertiesInternal)Property).Document; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractPropertiesInternal)Property).Document = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties _property; + + /// Wiki details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + + /// Creates an new instance. + public WikiContract() + { + + } + } + /// Wiki properties + public partial interface IWikiContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Collection wiki documents included into this wiki. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection wiki documents included into this wiki.", + SerializedName = @"documents", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract[] Document { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + /// Wiki properties + internal partial interface IWikiContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Collection wiki documents included into this wiki. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract[] Document { get; set; } + + string ETag { get; set; } + /// Wiki details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContract.json.cs new file mode 100644 index 000000000000..d102d61feec1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki properties + public partial class WikiContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WikiContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WikiContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContractProperties.cs new file mode 100644 index 000000000000..fcfb669c8eba --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContractProperties.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki contract details + public partial class WikiContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract[] _document; + + /// Collection wiki documents included into this wiki. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract[] Document { get => this._document; set => this._document = value; } + + /// Creates an new instance. + public WikiContractProperties() + { + + } + } + /// Wiki contract details + public partial interface IWikiContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Collection wiki documents included into this wiki. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection wiki documents included into this wiki.", + SerializedName = @"documents", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract[] Document { get; set; } + + } + /// Wiki contract details + internal partial interface IWikiContractPropertiesInternal + + { + /// Collection wiki documents included into this wiki. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract[] Document { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContractProperties.json.cs new file mode 100644 index 000000000000..956e55413951 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiContractProperties.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki contract details + public partial class WikiContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WikiContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._document) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._document ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("documents",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WikiContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_document = If( json?.PropertyT("documents"), out var __jsonDocuments) ? If( __jsonDocuments as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiDocumentationContract.FromJson(__u) )) ))() : null : Document;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiDocumentationContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiDocumentationContract.cs new file mode 100644 index 000000000000..01da1774b503 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiDocumentationContract.cs @@ -0,0 +1,51 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki documentation details. + public partial class WikiDocumentationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContractInternal + { + + /// Backing field for property. + private string _documentationId; + + /// Documentation Identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DocumentationId { get => this._documentationId; set => this._documentationId = value; } + + /// Creates an new instance. + public WikiDocumentationContract() + { + + } + } + /// Wiki documentation details. + public partial interface IWikiDocumentationContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Documentation Identifier + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Documentation Identifier", + SerializedName = @"documentationId", + PossibleTypes = new [] { typeof(string) })] + string DocumentationId { get; set; } + + } + /// Wiki documentation details. + internal partial interface IWikiDocumentationContractInternal + + { + /// Documentation Identifier + string DocumentationId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiDocumentationContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiDocumentationContract.json.cs new file mode 100644 index 000000000000..927bf38c9b72 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiDocumentationContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki documentation details. + public partial class WikiDocumentationContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WikiDocumentationContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._documentationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._documentationId.ToString()) : null, "documentationId" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WikiDocumentationContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_documentationId = If( json?.PropertyT("documentationId"), out var __jsonDocumentationId) ? (string)__jsonDocumentationId : (string)DocumentationId;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiUpdateContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiUpdateContract.cs new file mode 100644 index 000000000000..7ff874fe1e51 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiUpdateContract.cs @@ -0,0 +1,60 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki update contract details. + public partial class WikiUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContractInternal + { + + /// Collection wiki documents included into this wiki. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract[] Document { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractPropertiesInternal)Property).Document; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractPropertiesInternal)Property).Document = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContractProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties _property; + + /// Wiki details. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContractProperties()); set => this._property = value; } + + /// Creates an new instance. + public WikiUpdateContract() + { + + } + } + /// Wiki update contract details. + public partial interface IWikiUpdateContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Collection wiki documents included into this wiki. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Collection wiki documents included into this wiki.", + SerializedName = @"documents", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract[] Document { get; set; } + + } + /// Wiki update contract details. + internal partial interface IWikiUpdateContractInternal + + { + /// Collection wiki documents included into this wiki. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiDocumentationContract[] Document { get; set; } + /// Wiki details. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiUpdateContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiUpdateContract.json.cs new file mode 100644 index 000000000000..b38263736f15 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WikiUpdateContract.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Wiki update contract details. + public partial class WikiUpdateContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWikiUpdateContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WikiUpdateContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WikiUpdateContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WikiContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceCollection.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceCollection.cs new file mode 100644 index 000000000000..b0899507a34c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceCollection.cs @@ -0,0 +1,85 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged workspace list representation. + public partial class WorkspaceCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceCollectionInternal + { + + /// Backing field for property. + private long? _count; + + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _nextLink; + + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract[] _value; + + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public WorkspaceCollection() + { + + } + } + /// Paged workspace list representation. + public partial interface IWorkspaceCollection : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Total record count number across all pages. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total record count number across all pages.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// Next page link if any. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Next page link if any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Page values. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Page values.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract[] Value { get; set; } + + } + /// Paged workspace list representation. + internal partial interface IWorkspaceCollectionInternal + + { + /// Total record count number across all pages. + long? Count { get; set; } + /// Next page link if any. + string NextLink { get; set; } + /// Page values. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceCollection.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceCollection.json.cs new file mode 100644 index 000000000000..3303922f1217 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceCollection.json.cs @@ -0,0 +1,120 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Paged workspace list representation. + public partial class WorkspaceCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceCollection(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNumber((long)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceCollection(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract) (Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WorkspaceContract.FromJson(__u) )) ))() : null : Value;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContract.cs new file mode 100644 index 000000000000..77ec76cf7b42 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContract.cs @@ -0,0 +1,143 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Workspace details. + public partial class WorkspaceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(); + + /// Description of the workspace. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractPropertiesInternal)Property).Description = value ?? null; } + + /// Name of the workspace. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractPropertiesInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractProperties Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WorkspaceContractProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractProperties _property; + + /// Workspace entity contract properties. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WorkspaceContractProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal)__resource).Type; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + + /// Creates an new instance. + public WorkspaceContract() + { + + } + } + /// Workspace details. + public partial interface IWorkspaceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResource + { + /// Description of the workspace. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the workspace.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Name of the workspace. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the workspace.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + /// Workspace details. + internal partial interface IWorkspaceContractInternal : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IResourceInternal + { + /// Description of the workspace. + string Description { get; set; } + /// Name of the workspace. + string DisplayName { get; set; } + + string ETag { get; set; } + /// Workspace entity contract properties. + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContract.json.cs new file mode 100644 index 000000000000..ff6a8e76fe23 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContract.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Workspace details. + public partial class WorkspaceContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceContract(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.WorkspaceContractProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContractProperties.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContractProperties.cs new file mode 100644 index 000000000000..6ee7e723d435 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContractProperties.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Workspace entity properties. + public partial class WorkspaceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractProperties, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractPropertiesInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the workspace. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _displayName; + + /// Name of the workspace. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Creates an new instance. + public WorkspaceContractProperties() + { + + } + } + /// Workspace entity properties. + public partial interface IWorkspaceContractProperties : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Description of the workspace. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the workspace.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Name of the workspace. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the workspace.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + + } + /// Workspace entity properties. + internal partial interface IWorkspaceContractPropertiesInternal + + { + /// Description of the workspace. + string Description { get; set; } + /// Name of the workspace. + string DisplayName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContractProperties.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContractProperties.json.cs new file mode 100644 index 000000000000..72d0bfa50571 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/WorkspaceContractProperties.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Workspace entity properties. + public partial class WorkspaceContractProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IWorkspaceContractProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceContractProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceContractProperties(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/X509CertificateName.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/X509CertificateName.cs new file mode 100644 index 000000000000..976cdb18b4e4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/X509CertificateName.cs @@ -0,0 +1,68 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of server X509Names. + public partial class X509CertificateName : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateNameInternal + { + + /// Backing field for property. + private string _issuerCertificateThumbprint; + + /// Thumbprint for the Issuer of the Certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string IssuerCertificateThumbprint { get => this._issuerCertificateThumbprint; set => this._issuerCertificateThumbprint = value; } + + /// Backing field for property. + private string _name; + + /// Common Name of the Certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public X509CertificateName() + { + + } + } + /// Properties of server X509Names. + public partial interface IX509CertificateName : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// Thumbprint for the Issuer of the Certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint for the Issuer of the Certificate.", + SerializedName = @"issuerCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string IssuerCertificateThumbprint { get; set; } + /// Common Name of the Certificate. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Common Name of the Certificate.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Properties of server X509Names. + internal partial interface IX509CertificateNameInternal + + { + /// Thumbprint for the Issuer of the Certificate. + string IssuerCertificateThumbprint { get; set; } + /// Common Name of the Certificate. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/X509CertificateName.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/X509CertificateName.json.cs new file mode 100644 index 000000000000..9913cadfa486 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api20230501Preview/X509CertificateName.json.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Properties of server X509Names. + public partial class X509CertificateName + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20230501Preview.IX509CertificateName FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new X509CertificateName(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._issuerCertificateThumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._issuerCertificateThumbprint.ToString()) : null, "issuerCertificateThumbprint" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal X509CertificateName(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_issuerCertificateThumbprint = If( json?.PropertyT("issuerCertificateThumbprint"), out var __jsonIssuerCertificateThumbprint) ? (string)__jsonIssuerCertificateThumbprint : (string)IssuerCertificateThumbprint;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api30/SystemData.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api30/SystemData.cs new file mode 100644 index 000000000000..a71a5c9c84ec --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api30/SystemData.cs @@ -0,0 +1,136 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemDataInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdAt; + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedAt { get => this._createdAt; set => this._createdAt = value; } + + /// Backing field for property. + private string _createdBy; + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? _createdByType; + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedAt; + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedAt { get => this._lastModifiedAt; set => this._lastModifiedAt = value; } + + /// Backing field for property. + private string _lastModifiedBy; + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? _lastModifiedByType; + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + + /// Creates an new instance. + public SystemData() + { + + } + } + /// Metadata pertaining to creation and last modification of the resource. + public partial interface ISystemData : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string CreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? CreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? LastModifiedByType { get; set; } + + } + /// Metadata pertaining to creation and last modification of the resource. + internal partial interface ISystemDataInternal + + { + /// The timestamp of resource creation (UTC). + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + string CreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? CreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType? LastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api30/SystemData.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api30/SystemData.json.cs new file mode 100644 index 000000000000..3c7263f45d10 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/Api30/SystemData.json.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api30.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SystemData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add ); + AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add ); + AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt" ,container.Add ); + AddIf( null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add ); + AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add ); + AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDeleteAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDeleteAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..238455af0333 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDeleteAcceptedResponseHeaders.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiDeleteAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDeleteAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDeleteAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Creates an new instance. + public ApiDeleteAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDeleteAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDeleteAcceptedResponseHeadersInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader1) is string __headerAzureAsyncOperationHeader1 ? __headerAzureAsyncOperationHeader1 : (string)null; + } + } + } + public partial interface IApiDeleteAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IApiDeleteAcceptedResponseHeadersInternal + + { + string AzureAsyncOperation { get; set; } + + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDeleteAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDeleteAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..4fe566bd9f0c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDeleteAcceptedResponseHeaders.json.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiDeleteAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiDeleteAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDeleteAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDeleteAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDeleteAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiDeleteAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDiagnosticGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDiagnosticGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..815d911434f3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDiagnosticGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiDiagnosticGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDiagnosticGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDiagnosticGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public ApiDiagnosticGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDiagnosticGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiDiagnosticGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiDiagnosticGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDiagnosticGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDiagnosticGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..076f2c3334a4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiDiagnosticGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiDiagnosticGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiDiagnosticGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDiagnosticGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDiagnosticGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiDiagnosticGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiDiagnosticGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..4bccbf163917 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public ApiGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..6c6db401d034 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIdentity.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIdentity.cs new file mode 100644 index 000000000000..add890ef9d97 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIdentity.cs @@ -0,0 +1,1185 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIdentityInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName? _accessName; + + /// The identifier of the Access configuration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName? AccessName { get => this._accessName; set => this._accessName = value; } + + /// Backing field for property. + private string _apiId; + + /// + /// API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n + /// as a suffix where n is the revision number. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiId { get => this._apiId; set => this._apiId = value; } + + /// Backing field for property. + private string _apiLinkId; + + /// + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ApiLinkId { get => this._apiLinkId; set => this._apiLinkId = value; } + + /// Backing field for property. + private string _attachmentId; + + /// Attachment identifier within an Issue. Must be unique in the current Issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AttachmentId { get => this._attachmentId; set => this._attachmentId = value; } + + /// Backing field for property. + private string _authorizationAccessPolicyId; + + /// Identifier of the authorization access policy. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AuthorizationAccessPolicyId { get => this._authorizationAccessPolicyId; set => this._authorizationAccessPolicyId = value; } + + /// Backing field for property. + private string _authorizationId; + + /// Identifier of the authorization. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AuthorizationId { get => this._authorizationId; set => this._authorizationId = value; } + + /// Backing field for property. + private string _authorizationProviderId; + + /// Identifier of the authorization provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AuthorizationProviderId { get => this._authorizationProviderId; set => this._authorizationProviderId = value; } + + /// Backing field for property. + private string _authsid; + + /// Identifier of the authorization server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Authsid { get => this._authsid; set => this._authsid = value; } + + /// Backing field for property. + private string _backendId; + + /// + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string BackendId { get => this._backendId; set => this._backendId = value; } + + /// Backing field for property. + private string _cacheId; + + /// + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string CacheId { get => this._cacheId; set => this._cacheId = value; } + + /// Backing field for property. + private string _certificateId; + + /// + /// Identifier of the certificate entity. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string CertificateId { get => this._certificateId; set => this._certificateId = value; } + + /// Backing field for property. + private string _commentId; + + /// Comment identifier within an Issue. Must be unique in the current Issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string CommentId { get => this._commentId; set => this._commentId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName? _configurationName; + + /// The identifier of the Git Configuration Operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName? ConfigurationName { get => this._configurationName; set => this._configurationName = value; } + + /// Backing field for property. + private string _contentItemId; + + /// Content item identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ContentItemId { get => this._contentItemId; set => this._contentItemId = value; } + + /// Backing field for property. + private string _contentTypeId; + + /// Content type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ContentTypeId { get => this._contentTypeId; set => this._contentTypeId = value; } + + /// Backing field for property. + private string _diagnosticId; + + /// + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DiagnosticId { get => this._diagnosticId; set => this._diagnosticId = value; } + + /// Backing field for property. + private string _documentationId; + + /// + /// Documentation identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string DocumentationId { get => this._documentationId; set => this._documentationId = value; } + + /// Backing field for property. + private string _email; + + /// Email identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Email { get => this._email; set => this._email = value; } + + /// Backing field for property. + private string _gatewayId; + + /// + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string GatewayId { get => this._gatewayId; set => this._gatewayId = value; } + + /// Backing field for property. + private string _groupId; + + /// + /// Group identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string GroupId { get => this._groupId; set => this._groupId = value; } + + /// Backing field for property. + private string _groupLinkId; + + /// + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string GroupLinkId { get => this._groupLinkId; set => this._groupLinkId = value; } + + /// Backing field for property. + private string _hcId; + + /// + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string HcId { get => this._hcId; set => this._hcId = value; } + + /// Backing field for property. + private string _id; + + /// A resource identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _id1; + + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Id1 { get => this._id1; set => this._id1 = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? _identityProviderName; + + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? IdentityProviderName { get => this._identityProviderName; set => this._identityProviderName = value; } + + /// Backing field for property. + private string _issueId; + + /// + /// Issue identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string IssueId { get => this._issueId; set => this._issueId = value; } + + /// Backing field for property. + private string _location; + + /// The location of the deleted API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private string _locationName; + + /// + /// Location in which the API Management service is deployed. This is one of the Azure Regions like West US, East US, South + /// Central US. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string LocationName { get => this._locationName; set => this._locationName = value; } + + /// Backing field for property. + private string _loggerId; + + /// Logger identifier. Must be unique in the API Management service instance. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string LoggerId { get => this._loggerId; set => this._loggerId = value; } + + /// Backing field for property. + private string _namedValueId; + + /// Identifier of the NamedValue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string NamedValueId { get => this._namedValueId; set => this._namedValueId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName? _notificationName; + + /// Notification Name Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName? NotificationName { get => this._notificationName; set => this._notificationName = value; } + + /// Backing field for property. + private string _operationId; + + /// + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// Backing field for property. + private string _operationLinkId; + + /// + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string OperationLinkId { get => this._operationLinkId; set => this._operationLinkId = value; } + + /// Backing field for property. + private string _opid; + + /// Identifier of the OpenID Connect Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Opid { get => this._opid; set => this._opid = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName? _policyId; + + /// The identifier of the Policy. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName? PolicyId { get => this._policyId; set => this._policyId = value; } + + /// Backing field for property. + private string _policyRestrictionId; + + /// Policy restrictions after an entity level + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PolicyRestrictionId { get => this._policyRestrictionId; set => this._policyRestrictionId = value; } + + /// Backing field for property. + private string _portalConfigId; + + /// Portal configuration identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PortalConfigId { get => this._portalConfigId; set => this._portalConfigId = value; } + + /// Backing field for property. + private string _portalRevisionId; + + /// + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PortalRevisionId { get => this._portalRevisionId; set => this._portalRevisionId = value; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// Name of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = value; } + + /// Backing field for property. + private string _privateLinkSubResourceName; + + /// Name of the private link resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string PrivateLinkSubResourceName { get => this._privateLinkSubResourceName; set => this._privateLinkSubResourceName = value; } + + /// Backing field for property. + private string _productId; + + /// + /// Product identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProductId { get => this._productId; set => this._productId = value; } + + /// Backing field for property. + private string _productLinkId; + + /// + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ProductLinkId { get => this._productLinkId; set => this._productLinkId = value; } + + /// Backing field for property. + private string _quotaCounterKey; + + /// + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For + /// Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined + /// as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string QuotaCounterKey { get => this._quotaCounterKey; set => this._quotaCounterKey = value; } + + /// Backing field for property. + private string _quotaPeriodKey; + + /// Quota period key identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string QuotaPeriodKey { get => this._quotaPeriodKey; set => this._quotaPeriodKey = value; } + + /// Backing field for property. + private string _releaseId; + + /// + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ReleaseId { get => this._releaseId; set => this._releaseId = value; } + + /// Backing field for property. + private string _resolverId; + + /// + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResolverId { get => this._resolverId; set => this._resolverId = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _schemaId; + + /// + /// Schema id identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SchemaId { get => this._schemaId; set => this._schemaId = value; } + + /// Backing field for property. + private string _serviceName; + + /// The name of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ServiceName { get => this._serviceName; set => this._serviceName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName? _settingsType; + + /// The identifier of the settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName? SettingsType { get => this._settingsType; set => this._settingsType = value; } + + /// Backing field for property. + private string _sid; + + /// + /// Subscription entity Identifier. The entity represents the association between a user and a product in API Management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Sid { get => this._sid; set => this._sid = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. The value must be an UUID. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _tagDescriptionId; + + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TagDescriptionId { get => this._tagDescriptionId; set => this._tagDescriptionId = value; } + + /// Backing field for property. + private string _tagId; + + /// Tag identifier. Must be unique in the current API Management service instance. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string TagId { get => this._tagId; set => this._tagId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName? _templateName; + + /// Email Template Name Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName? TemplateName { get => this._templateName; set => this._templateName = value; } + + /// Backing field for property. + private string _userId; + + /// User identifier. Must be unique in the current API Management service instance. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string UserId { get => this._userId; set => this._userId = value; } + + /// Backing field for property. + private string _versionSetId; + + /// + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string VersionSetId { get => this._versionSetId; set => this._versionSetId = value; } + + /// Backing field for property. + private string _workspaceId; + + /// + /// Workspace identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string WorkspaceId { get => this._workspaceId; set => this._workspaceId = value; } + + /// Creates an new instance. + public ApiIdentity() + { + + } + } + public partial interface IApiIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable + { + /// The identifier of the Access configuration. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifier of the Access configuration.", + SerializedName = @"accessName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName? AccessName { get; set; } + /// + /// API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n + /// as a suffix where n is the revision number. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.", + SerializedName = @"apiId", + PossibleTypes = new [] { typeof(string) })] + string ApiId { get; set; } + /// + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product-API link identifier. Must be unique in the current API Management service instance.", + SerializedName = @"apiLinkId", + PossibleTypes = new [] { typeof(string) })] + string ApiLinkId { get; set; } + /// Attachment identifier within an Issue. Must be unique in the current Issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Attachment identifier within an Issue. Must be unique in the current Issue.", + SerializedName = @"attachmentId", + PossibleTypes = new [] { typeof(string) })] + string AttachmentId { get; set; } + /// Identifier of the authorization access policy. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the authorization access policy.", + SerializedName = @"authorizationAccessPolicyId", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationAccessPolicyId { get; set; } + /// Identifier of the authorization. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the authorization.", + SerializedName = @"authorizationId", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationId { get; set; } + /// Identifier of the authorization provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the authorization provider.", + SerializedName = @"authorizationProviderId", + PossibleTypes = new [] { typeof(string) })] + string AuthorizationProviderId { get; set; } + /// Identifier of the authorization server. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the authorization server.", + SerializedName = @"authsid", + PossibleTypes = new [] { typeof(string) })] + string Authsid { get; set; } + /// + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the Backend entity. Must be unique in the current API Management service instance.", + SerializedName = @"backendId", + PossibleTypes = new [] { typeof(string) })] + string BackendId { get; set; } + /// + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier).", + SerializedName = @"cacheId", + PossibleTypes = new [] { typeof(string) })] + string CacheId { get; set; } + /// + /// Identifier of the certificate entity. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the certificate entity. Must be unique in the current API Management service instance.", + SerializedName = @"certificateId", + PossibleTypes = new [] { typeof(string) })] + string CertificateId { get; set; } + /// Comment identifier within an Issue. Must be unique in the current Issue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comment identifier within an Issue. Must be unique in the current Issue.", + SerializedName = @"commentId", + PossibleTypes = new [] { typeof(string) })] + string CommentId { get; set; } + /// The identifier of the Git Configuration Operation. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifier of the Git Configuration Operation.", + SerializedName = @"configurationName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName? ConfigurationName { get; set; } + /// Content item identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content item identifier.", + SerializedName = @"contentItemId", + PossibleTypes = new [] { typeof(string) })] + string ContentItemId { get; set; } + /// Content type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Content type identifier.", + SerializedName = @"contentTypeId", + PossibleTypes = new [] { typeof(string) })] + string ContentTypeId { get; set; } + /// + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Diagnostic identifier. Must be unique in the current API Management service instance.", + SerializedName = @"diagnosticId", + PossibleTypes = new [] { typeof(string) })] + string DiagnosticId { get; set; } + /// + /// Documentation identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Documentation identifier. Must be unique in the current API Management service instance.", + SerializedName = @"documentationId", + PossibleTypes = new [] { typeof(string) })] + string DocumentationId { get; set; } + /// Email identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email identifier.", + SerializedName = @"email", + PossibleTypes = new [] { typeof(string) })] + string Email { get; set; } + /// + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'", + SerializedName = @"gatewayId", + PossibleTypes = new [] { typeof(string) })] + string GatewayId { get; set; } + /// + /// Group identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Group identifier. Must be unique in the current API Management service instance.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + string GroupId { get; set; } + /// + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product-Group link identifier. Must be unique in the current API Management service instance.", + SerializedName = @"groupLinkId", + PossibleTypes = new [] { typeof(string) })] + string GroupLinkId { get; set; } + /// + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity.", + SerializedName = @"hcId", + PossibleTypes = new [] { typeof(string) })] + string HcId { get; set; } + /// A resource identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A resource identifier.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identity path", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id1 { get; set; } + /// Identity Provider Type identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity Provider Type identifier.", + SerializedName = @"identityProviderName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? IdentityProviderName { get; set; } + /// + /// Issue identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Issue identifier. Must be unique in the current API Management service instance.", + SerializedName = @"issueId", + PossibleTypes = new [] { typeof(string) })] + string IssueId { get; set; } + /// The location of the deleted API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The location of the deleted API Management service.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// + /// Location in which the API Management service is deployed. This is one of the Azure Regions like West US, East US, South + /// Central US. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Location in which the API Management service is deployed. This is one of the Azure Regions like West US, East US, South Central US.", + SerializedName = @"locationName", + PossibleTypes = new [] { typeof(string) })] + string LocationName { get; set; } + /// Logger identifier. Must be unique in the API Management service instance. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Logger identifier. Must be unique in the API Management service instance.", + SerializedName = @"loggerId", + PossibleTypes = new [] { typeof(string) })] + string LoggerId { get; set; } + /// Identifier of the NamedValue. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the NamedValue.", + SerializedName = @"namedValueId", + PossibleTypes = new [] { typeof(string) })] + string NamedValueId { get; set; } + /// Notification Name Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Notification Name Identifier.", + SerializedName = @"notificationName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName? NotificationName { get; set; } + /// + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation identifier within an API. Must be unique in the current API Management service instance.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + /// + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag-operation link identifier. Must be unique in the current API Management service instance.", + SerializedName = @"operationLinkId", + PossibleTypes = new [] { typeof(string) })] + string OperationLinkId { get; set; } + /// Identifier of the OpenID Connect Provider. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the OpenID Connect Provider.", + SerializedName = @"opid", + PossibleTypes = new [] { typeof(string) })] + string Opid { get; set; } + /// The identifier of the Policy. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifier of the Policy.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName? PolicyId { get; set; } + /// Policy restrictions after an entity level + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy restrictions after an entity level", + SerializedName = @"policyRestrictionId", + PossibleTypes = new [] { typeof(string) })] + string PolicyRestrictionId { get; set; } + /// Portal configuration identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Portal configuration identifier.", + SerializedName = @"portalConfigId", + PossibleTypes = new [] { typeof(string) })] + string PortalConfigId { get; set; } + /// + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Portal revision identifier. Must be unique in the current API Management service instance.", + SerializedName = @"portalRevisionId", + PossibleTypes = new [] { typeof(string) })] + string PortalRevisionId { get; set; } + /// Name of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the private endpoint connection.", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointConnectionName { get; set; } + /// Name of the private link resource. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the private link resource.", + SerializedName = @"privateLinkSubResourceName", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkSubResourceName { get; set; } + /// + /// Product identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product identifier. Must be unique in the current API Management service instance.", + SerializedName = @"productId", + PossibleTypes = new [] { typeof(string) })] + string ProductId { get; set; } + /// + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag-product link identifier. Must be unique in the current API Management service instance.", + SerializedName = @"productLinkId", + PossibleTypes = new [] { typeof(string) })] + string ProductLinkId { get; set; } + /// + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For + /// Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined + /// as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key=""boo"" in the policy, then it’s accessible by ""boo"" counter key. But if it’s defined as counter-key=""@(""b""+""a"")"" then it will be accessible by ""ba"" key", + SerializedName = @"quotaCounterKey", + PossibleTypes = new [] { typeof(string) })] + string QuotaCounterKey { get; set; } + /// Quota period key identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Quota period key identifier.", + SerializedName = @"quotaPeriodKey", + PossibleTypes = new [] { typeof(string) })] + string QuotaPeriodKey { get; set; } + /// + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Release identifier within an API. Must be unique in the current API Management service instance.", + SerializedName = @"releaseId", + PossibleTypes = new [] { typeof(string) })] + string ReleaseId { get; set; } + /// + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance.", + SerializedName = @"resolverId", + PossibleTypes = new [] { typeof(string) })] + string ResolverId { get; set; } + /// The name of the resource group. The name is case insensitive. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// + /// Schema id identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Schema id identifier. Must be unique in the current API Management service instance.", + SerializedName = @"schemaId", + PossibleTypes = new [] { typeof(string) })] + string SchemaId { get; set; } + /// The name of the API Management service. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the API Management service.", + SerializedName = @"serviceName", + PossibleTypes = new [] { typeof(string) })] + string ServiceName { get; set; } + /// The identifier of the settings. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identifier of the settings.", + SerializedName = @"settingsType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName? SettingsType { get; set; } + /// + /// Subscription entity Identifier. The entity represents the association between a user and a product in API Management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Subscription entity Identifier. The entity represents the association between a user and a product in API Management.", + SerializedName = @"sid", + PossibleTypes = new [] { typeof(string) })] + string Sid { get; set; } + /// The ID of the target subscription. The value must be an UUID. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names.", + SerializedName = @"tagDescriptionId", + PossibleTypes = new [] { typeof(string) })] + string TagDescriptionId { get; set; } + /// Tag identifier. Must be unique in the current API Management service instance. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tag identifier. Must be unique in the current API Management service instance.", + SerializedName = @"tagId", + PossibleTypes = new [] { typeof(string) })] + string TagId { get; set; } + /// Email Template Name Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email Template Name Identifier.", + SerializedName = @"templateName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName) })] + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName? TemplateName { get; set; } + /// User identifier. Must be unique in the current API Management service instance. + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User identifier. Must be unique in the current API Management service instance.", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; set; } + /// + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Api Version Set identifier. Must be unique in the current API Management service instance.", + SerializedName = @"versionSetId", + PossibleTypes = new [] { typeof(string) })] + string VersionSetId { get; set; } + /// + /// Workspace identifier. Must be unique in the current API Management service instance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Workspace identifier. Must be unique in the current API Management service instance.", + SerializedName = @"workspaceId", + PossibleTypes = new [] { typeof(string) })] + string WorkspaceId { get; set; } + + } + internal partial interface IApiIdentityInternal + + { + /// The identifier of the Access configuration. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName? AccessName { get; set; } + /// + /// API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n + /// as a suffix where n is the revision number. + /// + string ApiId { get; set; } + /// + /// Product-API link identifier. Must be unique in the current API Management service instance. + /// + string ApiLinkId { get; set; } + /// Attachment identifier within an Issue. Must be unique in the current Issue. + string AttachmentId { get; set; } + /// Identifier of the authorization access policy. + string AuthorizationAccessPolicyId { get; set; } + /// Identifier of the authorization. + string AuthorizationId { get; set; } + /// Identifier of the authorization provider. + string AuthorizationProviderId { get; set; } + /// Identifier of the authorization server. + string Authsid { get; set; } + /// + /// Identifier of the Backend entity. Must be unique in the current API Management service instance. + /// + string BackendId { get; set; } + /// + /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). + /// + string CacheId { get; set; } + /// + /// Identifier of the certificate entity. Must be unique in the current API Management service instance. + /// + string CertificateId { get; set; } + /// Comment identifier within an Issue. Must be unique in the current Issue. + string CommentId { get; set; } + /// The identifier of the Git Configuration Operation. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName? ConfigurationName { get; set; } + /// Content item identifier. + string ContentItemId { get; set; } + /// Content type identifier. + string ContentTypeId { get; set; } + /// + /// Diagnostic identifier. Must be unique in the current API Management service instance. + /// + string DiagnosticId { get; set; } + /// + /// Documentation identifier. Must be unique in the current API Management service instance. + /// + string DocumentationId { get; set; } + /// Email identifier. + string Email { get; set; } + /// + /// Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed' + /// + string GatewayId { get; set; } + /// + /// Group identifier. Must be unique in the current API Management service instance. + /// + string GroupId { get; set; } + /// + /// Product-Group link identifier. Must be unique in the current API Management service instance. + /// + string GroupLinkId { get; set; } + /// + /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + /// + string HcId { get; set; } + /// A resource identifier. + string Id { get; set; } + /// Resource identity path + string Id1 { get; set; } + /// Identity Provider Type identifier. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType? IdentityProviderName { get; set; } + /// + /// Issue identifier. Must be unique in the current API Management service instance. + /// + string IssueId { get; set; } + /// The location of the deleted API Management service. + string Location { get; set; } + /// + /// Location in which the API Management service is deployed. This is one of the Azure Regions like West US, East US, South + /// Central US. + /// + string LocationName { get; set; } + /// Logger identifier. Must be unique in the API Management service instance. + string LoggerId { get; set; } + /// Identifier of the NamedValue. + string NamedValueId { get; set; } + /// Notification Name Identifier. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName? NotificationName { get; set; } + /// + /// Operation identifier within an API. Must be unique in the current API Management service instance. + /// + string OperationId { get; set; } + /// + /// Tag-operation link identifier. Must be unique in the current API Management service instance. + /// + string OperationLinkId { get; set; } + /// Identifier of the OpenID Connect Provider. + string Opid { get; set; } + /// The identifier of the Policy. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName? PolicyId { get; set; } + /// Policy restrictions after an entity level + string PolicyRestrictionId { get; set; } + /// Portal configuration identifier. + string PortalConfigId { get; set; } + /// + /// Portal revision identifier. Must be unique in the current API Management service instance. + /// + string PortalRevisionId { get; set; } + /// Name of the private endpoint connection. + string PrivateEndpointConnectionName { get; set; } + /// Name of the private link resource. + string PrivateLinkSubResourceName { get; set; } + /// + /// Product identifier. Must be unique in the current API Management service instance. + /// + string ProductId { get; set; } + /// + /// Tag-product link identifier. Must be unique in the current API Management service instance. + /// + string ProductLinkId { get; set; } + /// + /// Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For + /// Example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined + /// as counter-key="@("b"+"a")" then it will be accessible by "ba" key + /// + string QuotaCounterKey { get; set; } + /// Quota period key identifier. + string QuotaPeriodKey { get; set; } + /// + /// Release identifier within an API. Must be unique in the current API Management service instance. + /// + string ReleaseId { get; set; } + /// + /// Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. + /// + string ResolverId { get; set; } + /// The name of the resource group. The name is case insensitive. + string ResourceGroupName { get; set; } + /// + /// Schema id identifier. Must be unique in the current API Management service instance. + /// + string SchemaId { get; set; } + /// The name of the API Management service. + string ServiceName { get; set; } + /// The identifier of the settings. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName? SettingsType { get; set; } + /// + /// Subscription entity Identifier. The entity represents the association between a user and a product in API Management. + /// + string Sid { get; set; } + /// The ID of the target subscription. The value must be an UUID. + string SubscriptionId { get; set; } + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names. + /// + string TagDescriptionId { get; set; } + /// Tag identifier. Must be unique in the current API Management service instance. + string TagId { get; set; } + /// Email Template Name Identifier. + Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName? TemplateName { get; set; } + /// User identifier. Must be unique in the current API Management service instance. + string UserId { get; set; } + /// + /// Api Version Set identifier. Must be unique in the current API Management service instance. + /// + string VersionSetId { get; set; } + /// + /// Workspace identifier. Must be unique in the current API Management service instance. + /// + string WorkspaceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIdentity.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIdentity.json.cs new file mode 100644 index 000000000000..22b884d7e0f2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIdentity.json.cs @@ -0,0 +1,219 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiIdentity(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_serviceName = If( json?.PropertyT("serviceName"), out var __jsonServiceName) ? (string)__jsonServiceName : (string)ServiceName;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_apiId = If( json?.PropertyT("apiId"), out var __jsonApiId) ? (string)__jsonApiId : (string)ApiId;} + {_releaseId = If( json?.PropertyT("releaseId"), out var __jsonReleaseId) ? (string)__jsonReleaseId : (string)ReleaseId;} + {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} + {_policyId = If( json?.PropertyT("policyId"), out var __jsonPolicyId) ? (string)__jsonPolicyId : (string)PolicyId;} + {_tagId = If( json?.PropertyT("tagId"), out var __jsonTagId) ? (string)__jsonTagId : (string)TagId;} + {_productId = If( json?.PropertyT("productId"), out var __jsonProductId) ? (string)__jsonProductId : (string)ProductId;} + {_resolverId = If( json?.PropertyT("resolverId"), out var __jsonResolverId) ? (string)__jsonResolverId : (string)ResolverId;} + {_schemaId = If( json?.PropertyT("schemaId"), out var __jsonSchemaId) ? (string)__jsonSchemaId : (string)SchemaId;} + {_diagnosticId = If( json?.PropertyT("diagnosticId"), out var __jsonDiagnosticId) ? (string)__jsonDiagnosticId : (string)DiagnosticId;} + {_issueId = If( json?.PropertyT("issueId"), out var __jsonIssueId) ? (string)__jsonIssueId : (string)IssueId;} + {_commentId = If( json?.PropertyT("commentId"), out var __jsonCommentId) ? (string)__jsonCommentId : (string)CommentId;} + {_attachmentId = If( json?.PropertyT("attachmentId"), out var __jsonAttachmentId) ? (string)__jsonAttachmentId : (string)AttachmentId;} + {_tagDescriptionId = If( json?.PropertyT("tagDescriptionId"), out var __jsonTagDescriptionId) ? (string)__jsonTagDescriptionId : (string)TagDescriptionId;} + {_versionSetId = If( json?.PropertyT("versionSetId"), out var __jsonVersionSetId) ? (string)__jsonVersionSetId : (string)VersionSetId;} + {_authorizationProviderId = If( json?.PropertyT("authorizationProviderId"), out var __jsonAuthorizationProviderId) ? (string)__jsonAuthorizationProviderId : (string)AuthorizationProviderId;} + {_authorizationId = If( json?.PropertyT("authorizationId"), out var __jsonAuthorizationId) ? (string)__jsonAuthorizationId : (string)AuthorizationId;} + {_authorizationAccessPolicyId = If( json?.PropertyT("authorizationAccessPolicyId"), out var __jsonAuthorizationAccessPolicyId) ? (string)__jsonAuthorizationAccessPolicyId : (string)AuthorizationAccessPolicyId;} + {_authsid = If( json?.PropertyT("authsid"), out var __jsonAuthsid) ? (string)__jsonAuthsid : (string)Authsid;} + {_backendId = If( json?.PropertyT("backendId"), out var __jsonBackendId) ? (string)__jsonBackendId : (string)BackendId;} + {_cacheId = If( json?.PropertyT("cacheId"), out var __jsonCacheId) ? (string)__jsonCacheId : (string)CacheId;} + {_certificateId = If( json?.PropertyT("certificateId"), out var __jsonCertificateId) ? (string)__jsonCertificateId : (string)CertificateId;} + {_contentTypeId = If( json?.PropertyT("contentTypeId"), out var __jsonContentTypeId) ? (string)__jsonContentTypeId : (string)ContentTypeId;} + {_contentItemId = If( json?.PropertyT("contentItemId"), out var __jsonContentItemId) ? (string)__jsonContentItemId : (string)ContentItemId;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_documentationId = If( json?.PropertyT("documentationId"), out var __jsonDocumentationId) ? (string)__jsonDocumentationId : (string)DocumentationId;} + {_templateName = If( json?.PropertyT("templateName"), out var __jsonTemplateName) ? (string)__jsonTemplateName : (string)TemplateName;} + {_gatewayId = If( json?.PropertyT("gatewayId"), out var __jsonGatewayId) ? (string)__jsonGatewayId : (string)GatewayId;} + {_hcId = If( json?.PropertyT("hcId"), out var __jsonHcId) ? (string)__jsonHcId : (string)HcId;} + {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)GroupId;} + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} + {_identityProviderName = If( json?.PropertyT("identityProviderName"), out var __jsonIdentityProviderName) ? (string)__jsonIdentityProviderName : (string)IdentityProviderName;} + {_loggerId = If( json?.PropertyT("loggerId"), out var __jsonLoggerId) ? (string)__jsonLoggerId : (string)LoggerId;} + {_namedValueId = If( json?.PropertyT("namedValueId"), out var __jsonNamedValueId) ? (string)__jsonNamedValueId : (string)NamedValueId;} + {_locationName = If( json?.PropertyT("locationName"), out var __jsonLocationName) ? (string)__jsonLocationName : (string)LocationName;} + {_notificationName = If( json?.PropertyT("notificationName"), out var __jsonNotificationName) ? (string)__jsonNotificationName : (string)NotificationName;} + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} + {_opid = If( json?.PropertyT("opid"), out var __jsonOpid) ? (string)__jsonOpid : (string)Opid;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_policyRestrictionId = If( json?.PropertyT("policyRestrictionId"), out var __jsonPolicyRestrictionId) ? (string)__jsonPolicyRestrictionId : (string)PolicyRestrictionId;} + {_portalConfigId = If( json?.PropertyT("portalConfigId"), out var __jsonPortalConfigId) ? (string)__jsonPortalConfigId : (string)PortalConfigId;} + {_portalRevisionId = If( json?.PropertyT("portalRevisionId"), out var __jsonPortalRevisionId) ? (string)__jsonPortalRevisionId : (string)PortalRevisionId;} + {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)PrivateEndpointConnectionName;} + {_privateLinkSubResourceName = If( json?.PropertyT("privateLinkSubResourceName"), out var __jsonPrivateLinkSubResourceName) ? (string)__jsonPrivateLinkSubResourceName : (string)PrivateLinkSubResourceName;} + {_apiLinkId = If( json?.PropertyT("apiLinkId"), out var __jsonApiLinkId) ? (string)__jsonApiLinkId : (string)ApiLinkId;} + {_groupLinkId = If( json?.PropertyT("groupLinkId"), out var __jsonGroupLinkId) ? (string)__jsonGroupLinkId : (string)GroupLinkId;} + {_quotaCounterKey = If( json?.PropertyT("quotaCounterKey"), out var __jsonQuotaCounterKey) ? (string)__jsonQuotaCounterKey : (string)QuotaCounterKey;} + {_quotaPeriodKey = If( json?.PropertyT("quotaPeriodKey"), out var __jsonQuotaPeriodKey) ? (string)__jsonQuotaPeriodKey : (string)QuotaPeriodKey;} + {_settingsType = If( json?.PropertyT("settingsType"), out var __jsonSettingsType) ? (string)__jsonSettingsType : (string)SettingsType;} + {_sid = If( json?.PropertyT("sid"), out var __jsonSid) ? (string)__jsonSid : (string)Sid;} + {_operationLinkId = If( json?.PropertyT("operationLinkId"), out var __jsonOperationLinkId) ? (string)__jsonOperationLinkId : (string)OperationLinkId;} + {_productLinkId = If( json?.PropertyT("productLinkId"), out var __jsonProductLinkId) ? (string)__jsonProductLinkId : (string)ProductLinkId;} + {_accessName = If( json?.PropertyT("accessName"), out var __jsonAccessName) ? (string)__jsonAccessName : (string)AccessName;} + {_configurationName = If( json?.PropertyT("configurationName"), out var __jsonConfigurationName) ? (string)__jsonConfigurationName : (string)ConfigurationName;} + {_workspaceId = If( json?.PropertyT("workspaceId"), out var __jsonWorkspaceId) ? (string)__jsonWorkspaceId : (string)WorkspaceId;} + {_id1 = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id1;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIdentity. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIdentity. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._serviceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._serviceName.ToString()) : null, "serviceName" ,container.Add ); + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._apiId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiId.ToString()) : null, "apiId" ,container.Add ); + AddIf( null != (((object)this._releaseId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._releaseId.ToString()) : null, "releaseId" ,container.Add ); + AddIf( null != (((object)this._operationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._operationId.ToString()) : null, "operationId" ,container.Add ); + AddIf( null != (((object)this._policyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._policyId.ToString()) : null, "policyId" ,container.Add ); + AddIf( null != (((object)this._tagId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._tagId.ToString()) : null, "tagId" ,container.Add ); + AddIf( null != (((object)this._productId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._productId.ToString()) : null, "productId" ,container.Add ); + AddIf( null != (((object)this._resolverId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._resolverId.ToString()) : null, "resolverId" ,container.Add ); + AddIf( null != (((object)this._schemaId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._schemaId.ToString()) : null, "schemaId" ,container.Add ); + AddIf( null != (((object)this._diagnosticId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._diagnosticId.ToString()) : null, "diagnosticId" ,container.Add ); + AddIf( null != (((object)this._issueId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._issueId.ToString()) : null, "issueId" ,container.Add ); + AddIf( null != (((object)this._commentId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._commentId.ToString()) : null, "commentId" ,container.Add ); + AddIf( null != (((object)this._attachmentId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._attachmentId.ToString()) : null, "attachmentId" ,container.Add ); + AddIf( null != (((object)this._tagDescriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._tagDescriptionId.ToString()) : null, "tagDescriptionId" ,container.Add ); + AddIf( null != (((object)this._versionSetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._versionSetId.ToString()) : null, "versionSetId" ,container.Add ); + AddIf( null != (((object)this._authorizationProviderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._authorizationProviderId.ToString()) : null, "authorizationProviderId" ,container.Add ); + AddIf( null != (((object)this._authorizationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._authorizationId.ToString()) : null, "authorizationId" ,container.Add ); + AddIf( null != (((object)this._authorizationAccessPolicyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._authorizationAccessPolicyId.ToString()) : null, "authorizationAccessPolicyId" ,container.Add ); + AddIf( null != (((object)this._authsid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._authsid.ToString()) : null, "authsid" ,container.Add ); + AddIf( null != (((object)this._backendId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._backendId.ToString()) : null, "backendId" ,container.Add ); + AddIf( null != (((object)this._cacheId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._cacheId.ToString()) : null, "cacheId" ,container.Add ); + AddIf( null != (((object)this._certificateId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._certificateId.ToString()) : null, "certificateId" ,container.Add ); + AddIf( null != (((object)this._contentTypeId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._contentTypeId.ToString()) : null, "contentTypeId" ,container.Add ); + AddIf( null != (((object)this._contentItemId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._contentItemId.ToString()) : null, "contentItemId" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != (((object)this._documentationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._documentationId.ToString()) : null, "documentationId" ,container.Add ); + AddIf( null != (((object)this._templateName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._templateName.ToString()) : null, "templateName" ,container.Add ); + AddIf( null != (((object)this._gatewayId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._gatewayId.ToString()) : null, "gatewayId" ,container.Add ); + AddIf( null != (((object)this._hcId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._hcId.ToString()) : null, "hcId" ,container.Add ); + AddIf( null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId" ,container.Add ); + AddIf( null != (((object)this._userId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._userId.ToString()) : null, "userId" ,container.Add ); + AddIf( null != (((object)this._identityProviderName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._identityProviderName.ToString()) : null, "identityProviderName" ,container.Add ); + AddIf( null != (((object)this._loggerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._loggerId.ToString()) : null, "loggerId" ,container.Add ); + AddIf( null != (((object)this._namedValueId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._namedValueId.ToString()) : null, "namedValueId" ,container.Add ); + AddIf( null != (((object)this._locationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._locationName.ToString()) : null, "locationName" ,container.Add ); + AddIf( null != (((object)this._notificationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._notificationName.ToString()) : null, "notificationName" ,container.Add ); + AddIf( null != (((object)this._email)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._email.ToString()) : null, "email" ,container.Add ); + AddIf( null != (((object)this._opid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._opid.ToString()) : null, "opid" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._policyRestrictionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._policyRestrictionId.ToString()) : null, "policyRestrictionId" ,container.Add ); + AddIf( null != (((object)this._portalConfigId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._portalConfigId.ToString()) : null, "portalConfigId" ,container.Add ); + AddIf( null != (((object)this._portalRevisionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._portalRevisionId.ToString()) : null, "portalRevisionId" ,container.Add ); + AddIf( null != (((object)this._privateEndpointConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._privateEndpointConnectionName.ToString()) : null, "privateEndpointConnectionName" ,container.Add ); + AddIf( null != (((object)this._privateLinkSubResourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._privateLinkSubResourceName.ToString()) : null, "privateLinkSubResourceName" ,container.Add ); + AddIf( null != (((object)this._apiLinkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._apiLinkId.ToString()) : null, "apiLinkId" ,container.Add ); + AddIf( null != (((object)this._groupLinkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._groupLinkId.ToString()) : null, "groupLinkId" ,container.Add ); + AddIf( null != (((object)this._quotaCounterKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._quotaCounterKey.ToString()) : null, "quotaCounterKey" ,container.Add ); + AddIf( null != (((object)this._quotaPeriodKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._quotaPeriodKey.ToString()) : null, "quotaPeriodKey" ,container.Add ); + AddIf( null != (((object)this._settingsType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._settingsType.ToString()) : null, "settingsType" ,container.Add ); + AddIf( null != (((object)this._sid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._sid.ToString()) : null, "sid" ,container.Add ); + AddIf( null != (((object)this._operationLinkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._operationLinkId.ToString()) : null, "operationLinkId" ,container.Add ); + AddIf( null != (((object)this._productLinkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._productLinkId.ToString()) : null, "productLinkId" ,container.Add ); + AddIf( null != (((object)this._accessName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._accessName.ToString()) : null, "accessName" ,container.Add ); + AddIf( null != (((object)this._configurationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._configurationName.ToString()) : null, "configurationName" ,container.Add ); + AddIf( null != (((object)this._workspaceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._workspaceId.ToString()) : null, "workspaceId" ,container.Add ); + AddIf( null != (((object)this._id1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id1.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueAttachmentGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueAttachmentGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..8cc4379bb06b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueAttachmentGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiIssueAttachmentGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueAttachmentGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueAttachmentGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public ApiIssueAttachmentGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueAttachmentGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiIssueAttachmentGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiIssueAttachmentGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueAttachmentGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueAttachmentGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..3518aa82b2a1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueAttachmentGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiIssueAttachmentGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiIssueAttachmentGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueAttachmentGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueAttachmentGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueAttachmentGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiIssueAttachmentGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueCommentGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueCommentGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..590cdc233910 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueCommentGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiIssueCommentGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueCommentGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueCommentGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public ApiIssueCommentGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueCommentGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiIssueCommentGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiIssueCommentGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueCommentGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueCommentGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..a1f6e7377d67 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueCommentGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiIssueCommentGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiIssueCommentGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueCommentGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueCommentGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueCommentGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiIssueCommentGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..cff489ff932c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiIssueGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public ApiIssueGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiIssueGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiIssueGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..b48edcf040d8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiIssueGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiIssueGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiIssueGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiIssueGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiIssueGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..7b0b23785d2d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..a07461e0010b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceApplyNetworkConfigurationUpdatesAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of + /// into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as + /// a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceBackupAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceBackupAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..144c73c1d9de --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceBackupAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceBackupAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceBackupAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceBackupAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ApiManagementServiceBackupAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceBackupAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IApiManagementServiceBackupAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IApiManagementServiceBackupAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceBackupAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceBackupAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..ca260a49ba92 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceBackupAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceBackupAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceBackupAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceBackupAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceBackupAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceBackupAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceBackupAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceMigrateToStv2AcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceMigrateToStv2AcceptedResponseHeaders.cs new file mode 100644 index 000000000000..d845b76562b4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceMigrateToStv2AcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceMigrateToStv2AcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceMigrateToStv2AcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceMigrateToStv2AcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ApiManagementServiceMigrateToStv2AcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceMigrateToStv2AcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IApiManagementServiceMigrateToStv2AcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IApiManagementServiceMigrateToStv2AcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceMigrateToStv2AcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceMigrateToStv2AcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..88aec83cfc37 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceMigrateToStv2AcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceMigrateToStv2AcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceMigrateToStv2AcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceMigrateToStv2AcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceMigrateToStv2AcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceMigrateToStv2AcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceMigrateToStv2AcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceRestoreAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceRestoreAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..778dd3fe721d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceRestoreAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceRestoreAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceRestoreAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceRestoreAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ApiManagementServiceRestoreAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceRestoreAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IApiManagementServiceRestoreAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IApiManagementServiceRestoreAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceRestoreAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceRestoreAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..fae29a0f1c6e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceRestoreAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceRestoreAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceRestoreAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceRestoreAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceRestoreAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceRestoreAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceRestoreAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceUpdateAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceUpdateAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..20f467ff2443 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceUpdateAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceUpdateAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceUpdateAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceUpdateAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ApiManagementServiceUpdateAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceUpdateAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IApiManagementServiceUpdateAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IApiManagementServiceUpdateAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceUpdateAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceUpdateAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..5405280f96f2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiManagementServiceUpdateAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiManagementServiceUpdateAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiManagementServiceUpdateAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceUpdateAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceUpdateAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiManagementServiceUpdateAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiManagementServiceUpdateAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..6804cdd4fb4d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiOperationGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public ApiOperationGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiOperationGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiOperationGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..e5749ec644de --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiOperationGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiOperationGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiOperationGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b1125ff57741 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationPolicyGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiOperationPolicyGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationPolicyGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationPolicyGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public ApiOperationPolicyGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationPolicyGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiOperationPolicyGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiOperationPolicyGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..78417c4a0bd1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiOperationPolicyGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiOperationPolicyGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiOperationPolicyGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationPolicyGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationPolicyGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiOperationPolicyGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiOperationPolicyGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..be31605d87bc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiPolicyGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiPolicyGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiPolicyGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiPolicyGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public ApiPolicyGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiPolicyGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiPolicyGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiPolicyGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..24e385ccbd31 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiPolicyGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiPolicyGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiPolicyGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiPolicyGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiPolicyGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiPolicyGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiPolicyGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiReleaseGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiReleaseGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..8e9fd55cef92 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiReleaseGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiReleaseGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiReleaseGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiReleaseGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public ApiReleaseGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiReleaseGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiReleaseGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiReleaseGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiReleaseGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiReleaseGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9271962675f2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiReleaseGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiReleaseGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiReleaseGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiReleaseGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiReleaseGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiReleaseGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiReleaseGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiSchemaGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiSchemaGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..40dceaeaea87 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiSchemaGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiSchemaGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiSchemaGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiSchemaGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public ApiSchemaGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiSchemaGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiSchemaGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiSchemaGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiSchemaGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiSchemaGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..cd10e9ae3537 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiSchemaGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiSchemaGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiSchemaGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiSchemaGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiSchemaGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiSchemaGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiSchemaGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiTagDescriptionGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiTagDescriptionGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..3e818e6c9578 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiTagDescriptionGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiTagDescriptionGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiTagDescriptionGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiTagDescriptionGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public ApiTagDescriptionGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiTagDescriptionGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiTagDescriptionGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiTagDescriptionGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiTagDescriptionGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiTagDescriptionGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..28d5ba86e1b8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiTagDescriptionGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiTagDescriptionGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiTagDescriptionGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiTagDescriptionGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiTagDescriptionGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiTagDescriptionGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiTagDescriptionGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiVersionSetGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiVersionSetGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b23762c9f3ee --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiVersionSetGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiVersionSetGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiVersionSetGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiVersionSetGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public ApiVersionSetGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiVersionSetGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiVersionSetGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiVersionSetGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiVersionSetGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiVersionSetGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..29c71cc93f82 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiVersionSetGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiVersionSetGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiVersionSetGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiVersionSetGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiVersionSetGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiVersionSetGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiVersionSetGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiWikiGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiWikiGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..074b1678d162 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiWikiGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiWikiGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiWikiGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiWikiGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public ApiWikiGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiWikiGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IApiWikiGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IApiWikiGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiWikiGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiWikiGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..117dd5b456aa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ApiWikiGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ApiWikiGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ApiWikiGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiWikiGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiWikiGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IApiWikiGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ApiWikiGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationConfirmConsentCodeOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationConfirmConsentCodeOkResponseHeaders.cs new file mode 100644 index 000000000000..865ed30fa1de --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationConfirmConsentCodeOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class AuthorizationConfirmConsentCodeOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationConfirmConsentCodeOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationConfirmConsentCodeOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public AuthorizationConfirmConsentCodeOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationConfirmConsentCodeOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IAuthorizationConfirmConsentCodeOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IAuthorizationConfirmConsentCodeOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationConfirmConsentCodeOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationConfirmConsentCodeOkResponseHeaders.json.cs new file mode 100644 index 000000000000..043877838080 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationConfirmConsentCodeOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class AuthorizationConfirmConsentCodeOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationConfirmConsentCodeOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationConfirmConsentCodeOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationConfirmConsentCodeOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationConfirmConsentCodeOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationConfirmConsentCodeOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationServerGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationServerGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..83e774cf0620 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationServerGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class AuthorizationServerGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationServerGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationServerGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public AuthorizationServerGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationServerGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IAuthorizationServerGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IAuthorizationServerGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationServerGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationServerGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..415e57f71e03 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/AuthorizationServerGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class AuthorizationServerGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal AuthorizationServerGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationServerGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationServerGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IAuthorizationServerGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new AuthorizationServerGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/BackendGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/BackendGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..ba4148317d8b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/BackendGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class BackendGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IBackendGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IBackendGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public BackendGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IBackendGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IBackendGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IBackendGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/BackendGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/BackendGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..7ab0721de33f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/BackendGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class BackendGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal BackendGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IBackendGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IBackendGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IBackendGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new BackendGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/CacheGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/CacheGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..d19cc440068d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/CacheGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class CacheGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICacheGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICacheGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public CacheGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICacheGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface ICacheGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ICacheGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/CacheGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/CacheGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..3678695ef977 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/CacheGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class CacheGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CacheGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICacheGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICacheGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICacheGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CacheGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/CertificateGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/CertificateGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..ee0a3ccefe63 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/CertificateGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class CertificateGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICertificateGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICertificateGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public CertificateGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICertificateGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface ICertificateGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ICertificateGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/CertificateGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/CertificateGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..8fa51dad887f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/CertificateGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class CertificateGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal CertificateGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICertificateGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICertificateGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ICertificateGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new CertificateGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ContentItemGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ContentItemGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..aa6cb6657471 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ContentItemGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ContentItemGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IContentItemGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IContentItemGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public ContentItemGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IContentItemGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IContentItemGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IContentItemGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ContentItemGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ContentItemGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9e0327548ae0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ContentItemGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ContentItemGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ContentItemGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IContentItemGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IContentItemGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IContentItemGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ContentItemGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/DelegationSettingsGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DelegationSettingsGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..33f0df132483 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DelegationSettingsGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DelegationSettingsGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDelegationSettingsGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDelegationSettingsGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public DelegationSettingsGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDelegationSettingsGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IDelegationSettingsGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IDelegationSettingsGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/DelegationSettingsGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DelegationSettingsGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..7d9b0617de07 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DelegationSettingsGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DelegationSettingsGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DelegationSettingsGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDelegationSettingsGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDelegationSettingsGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDelegationSettingsGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DelegationSettingsGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/DiagnosticGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DiagnosticGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..d0befd1d5efb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DiagnosticGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DiagnosticGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDiagnosticGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDiagnosticGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public DiagnosticGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDiagnosticGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IDiagnosticGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IDiagnosticGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/DiagnosticGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DiagnosticGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..a79213a51ea2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DiagnosticGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DiagnosticGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DiagnosticGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDiagnosticGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDiagnosticGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDiagnosticGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DiagnosticGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/DocumentationGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DocumentationGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..08f64fe2e50d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DocumentationGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DocumentationGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDocumentationGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDocumentationGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public DocumentationGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDocumentationGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IDocumentationGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IDocumentationGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/DocumentationGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DocumentationGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..7542c8969a08 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/DocumentationGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class DocumentationGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal DocumentationGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDocumentationGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDocumentationGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IDocumentationGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new DocumentationGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/EmailTemplateGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/EmailTemplateGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b1709a5aacbc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/EmailTemplateGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class EmailTemplateGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IEmailTemplateGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IEmailTemplateGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public EmailTemplateGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IEmailTemplateGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IEmailTemplateGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IEmailTemplateGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/EmailTemplateGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/EmailTemplateGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..91aebc5a73d4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/EmailTemplateGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class EmailTemplateGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal EmailTemplateGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IEmailTemplateGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IEmailTemplateGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IEmailTemplateGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new EmailTemplateGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayApiGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayApiGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..99130f85382a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayApiGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GatewayApiGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayApiGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayApiGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public GatewayApiGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayApiGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IGatewayApiGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IGatewayApiGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayApiGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayApiGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..1d093ac4b79c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayApiGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GatewayApiGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayApiGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayApiGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayApiGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayApiGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayApiGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayCertificateAuthorityGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayCertificateAuthorityGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b3846bf92a06 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayCertificateAuthorityGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GatewayCertificateAuthorityGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayCertificateAuthorityGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayCertificateAuthorityGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public GatewayCertificateAuthorityGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayCertificateAuthorityGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IGatewayCertificateAuthorityGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IGatewayCertificateAuthorityGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayCertificateAuthorityGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayCertificateAuthorityGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..12dcda442e63 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayCertificateAuthorityGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GatewayCertificateAuthorityGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayCertificateAuthorityGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayCertificateAuthorityGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayCertificateAuthorityGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayCertificateAuthorityGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayCertificateAuthorityGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..6055db1b8edd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GatewayGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public GatewayGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IGatewayGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IGatewayGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..15083cd8ea31 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GatewayGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayHostnameConfigurationGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayHostnameConfigurationGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b1b0241e172f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayHostnameConfigurationGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GatewayHostnameConfigurationGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayHostnameConfigurationGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayHostnameConfigurationGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public GatewayHostnameConfigurationGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayHostnameConfigurationGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IGatewayHostnameConfigurationGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IGatewayHostnameConfigurationGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayHostnameConfigurationGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayHostnameConfigurationGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..a3837b6f9acb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayHostnameConfigurationGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GatewayHostnameConfigurationGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayHostnameConfigurationGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayHostnameConfigurationGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayHostnameConfigurationGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayHostnameConfigurationGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GatewayHostnameConfigurationGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayTraceContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayTraceContract.cs new file mode 100644 index 000000000000..74404421dd8e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayTraceContract.cs @@ -0,0 +1,35 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Trace collected in gateway. + public partial class GatewayTraceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayTraceContract, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayTraceContractInternal + { + + /// Creates an new instance. + public GatewayTraceContract() + { + + } + } + /// Trace collected in gateway. + public partial interface IGatewayTraceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + + } + /// Trace collected in gateway. + internal partial interface IGatewayTraceContractInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayTraceContract.dictionary.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayTraceContract.dictionary.cs new file mode 100644 index 000000000000..10a588373867 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayTraceContract.dictionary.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GatewayTraceContract : + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public global::System.Object this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, global::System.Object value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out global::System.Object value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Api.Models.GatewayTraceContract source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayTraceContract.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayTraceContract.json.cs new file mode 100644 index 000000000000..268b8a73e05a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GatewayTraceContract.json.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + /// Trace collected in gateway. + public partial class GatewayTraceContract + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayTraceContract. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayTraceContract. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGatewayTraceContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GatewayTraceContract(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + /// + internal GatewayTraceContract(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GlobalSchemaGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GlobalSchemaGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..f5b15b4d691b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GlobalSchemaGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GlobalSchemaGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGlobalSchemaGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGlobalSchemaGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public GlobalSchemaGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGlobalSchemaGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IGlobalSchemaGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IGlobalSchemaGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GlobalSchemaGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GlobalSchemaGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..e87d34ebf670 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GlobalSchemaGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GlobalSchemaGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGlobalSchemaGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGlobalSchemaGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGlobalSchemaGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GlobalSchemaGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GlobalSchemaGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..79d957849f7a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GraphQlApiResolverGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public GraphQlApiResolverGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IGraphQlApiResolverGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IGraphQlApiResolverGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..d45b220babb1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GraphQlApiResolverGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GraphQlApiResolverGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GraphQlApiResolverGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..a593d1b9c52f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverPolicyGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverPolicyGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverPolicyGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IGraphQlApiResolverPolicyGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IGraphQlApiResolverPolicyGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..521b6ab5db5c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverPolicyGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverPolicyGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGraphQlApiResolverPolicyGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GraphQlApiResolverPolicyGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GroupGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GroupGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..5fad395e807d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GroupGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GroupGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGroupGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGroupGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public GroupGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGroupGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IGroupGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IGroupGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/GroupGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GroupGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..19809631ecbb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/GroupGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class GroupGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGroupGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGroupGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IGroupGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new GroupGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal GroupGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/IdentityProviderGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/IdentityProviderGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..1e86c95bcd70 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/IdentityProviderGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class IdentityProviderGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IIdentityProviderGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IIdentityProviderGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + /// Creates an new instance. + /// + public IdentityProviderGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IIdentityProviderGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface IIdentityProviderGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IIdentityProviderGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/IdentityProviderGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/IdentityProviderGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9e3e861e4b6d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/IdentityProviderGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class IdentityProviderGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IIdentityProviderGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IIdentityProviderGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IIdentityProviderGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new IdentityProviderGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal IdentityProviderGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/LoggerGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/LoggerGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..b2cf42f891c5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/LoggerGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class LoggerGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ILoggerGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ILoggerGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Creates an new instance. + public LoggerGetEntityTagOkResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ILoggerGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + public partial interface ILoggerGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ILoggerGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/LoggerGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/LoggerGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9063b21cf42b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/LoggerGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class LoggerGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ILoggerGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ILoggerGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ILoggerGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new LoggerGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal LoggerGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..6234e00cef14 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class NamedValueGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public NamedValueGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface INamedValueGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface INamedValueGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..82de5d837131 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class NamedValueGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueRefreshSecretAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueRefreshSecretAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..eda2ee781dc3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueRefreshSecretAcceptedResponseHeaders.cs @@ -0,0 +1,77 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class NamedValueRefreshSecretAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueRefreshSecretAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueRefreshSecretAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueRefreshSecretAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueRefreshSecretAcceptedResponseHeadersInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader1) is string __headerAzureAsyncOperationHeader1 ? __headerAzureAsyncOperationHeader1 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public NamedValueRefreshSecretAcceptedResponseHeaders() + { + + } + } + public partial interface INamedValueRefreshSecretAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface INamedValueRefreshSecretAcceptedResponseHeadersInternal + + { + string AzureAsyncOperation { get; set; } + + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueRefreshSecretAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueRefreshSecretAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..f560ff1e7c0d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueRefreshSecretAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class NamedValueRefreshSecretAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueRefreshSecretAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueRefreshSecretAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueRefreshSecretAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueRefreshSecretAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueRefreshSecretAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueUpdateAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueUpdateAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..e1dd6e360036 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueUpdateAcceptedResponseHeaders.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class NamedValueUpdateAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueUpdateAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueUpdateAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueUpdateAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueUpdateAcceptedResponseHeadersInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader1) is string __headerAzureAsyncOperationHeader1 ? __headerAzureAsyncOperationHeader1 : (string)null; + } + } + + /// Creates an new instance. + public NamedValueUpdateAcceptedResponseHeaders() + { + + } + } + public partial interface INamedValueUpdateAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface INamedValueUpdateAcceptedResponseHeadersInternal + + { + string AzureAsyncOperation { get; set; } + + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueUpdateAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueUpdateAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..2ae41b3a6333 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/NamedValueUpdateAcceptedResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class NamedValueUpdateAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueUpdateAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueUpdateAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.INamedValueUpdateAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new NamedValueUpdateAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal NamedValueUpdateAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/OpenIdConnectProviderGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/OpenIdConnectProviderGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..c44e6aba374c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/OpenIdConnectProviderGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class OpenIdConnectProviderGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IOpenIdConnectProviderGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IOpenIdConnectProviderGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IOpenIdConnectProviderGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public OpenIdConnectProviderGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IOpenIdConnectProviderGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IOpenIdConnectProviderGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/OpenIdConnectProviderGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/OpenIdConnectProviderGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..30d0bbabe53c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/OpenIdConnectProviderGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class OpenIdConnectProviderGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IOpenIdConnectProviderGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IOpenIdConnectProviderGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IOpenIdConnectProviderGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new OpenIdConnectProviderGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal OpenIdConnectProviderGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PerformConnectivityCheckAsyncAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PerformConnectivityCheckAsyncAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..81725dc49739 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PerformConnectivityCheckAsyncAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PerformConnectivityCheckAsyncAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPerformConnectivityCheckAsyncAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPerformConnectivityCheckAsyncAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPerformConnectivityCheckAsyncAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public PerformConnectivityCheckAsyncAcceptedResponseHeaders() + { + + } + } + public partial interface IPerformConnectivityCheckAsyncAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IPerformConnectivityCheckAsyncAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PerformConnectivityCheckAsyncAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PerformConnectivityCheckAsyncAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..cdbe7728444e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PerformConnectivityCheckAsyncAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PerformConnectivityCheckAsyncAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPerformConnectivityCheckAsyncAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPerformConnectivityCheckAsyncAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPerformConnectivityCheckAsyncAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PerformConnectivityCheckAsyncAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PerformConnectivityCheckAsyncAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyFragmentGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyFragmentGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..5365848b23ce --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyFragmentGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PolicyFragmentGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyFragmentGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyFragmentGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyFragmentGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public PolicyFragmentGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IPolicyFragmentGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IPolicyFragmentGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyFragmentGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyFragmentGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..16357db90a7e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyFragmentGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PolicyFragmentGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyFragmentGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyFragmentGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyFragmentGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyFragmentGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyFragmentGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..e9691df9b2f0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PolicyGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public PolicyGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IPolicyGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IPolicyGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..258c38f0b60f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PolicyGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..332f50d84534 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PolicyRestrictionGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public PolicyRestrictionGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IPolicyRestrictionGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IPolicyRestrictionGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..0befb46e5ca7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PolicyRestrictionGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyRestrictionGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyRestrictionGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionValidationsByServiceAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionValidationsByServiceAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..406ccf8da3d3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionValidationsByServiceAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PolicyRestrictionValidationsByServiceAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionValidationsByServiceAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionValidationsByServiceAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionValidationsByServiceAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public PolicyRestrictionValidationsByServiceAcceptedResponseHeaders() + { + + } + } + public partial interface IPolicyRestrictionValidationsByServiceAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IPolicyRestrictionValidationsByServiceAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionValidationsByServiceAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionValidationsByServiceAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..b4b03d67c2c2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PolicyRestrictionValidationsByServiceAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PolicyRestrictionValidationsByServiceAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionValidationsByServiceAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionValidationsByServiceAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPolicyRestrictionValidationsByServiceAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PolicyRestrictionValidationsByServiceAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PolicyRestrictionValidationsByServiceAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalConfigGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalConfigGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..900b4909686c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalConfigGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalConfigGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalConfigGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalConfigGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public PortalConfigGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IPortalConfigGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IPortalConfigGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalConfigGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalConfigGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..eb6cfd34b0e8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalConfigGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalConfigGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalConfigGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalConfigGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalConfigGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalConfigGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalConfigGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..acb06df385c8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalRevisionGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public PortalRevisionGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IPortalRevisionGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IPortalRevisionGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..fcba24ae94a3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalRevisionGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalRevisionGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalRevisionGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionUpdateAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionUpdateAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..2109c5a568b7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionUpdateAcceptedResponseHeaders.cs @@ -0,0 +1,77 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalRevisionUpdateAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionUpdateAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionUpdateAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionUpdateAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionUpdateAcceptedResponseHeadersInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader1) is string __headerAzureAsyncOperationHeader1 ? __headerAzureAsyncOperationHeader1 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public PortalRevisionUpdateAcceptedResponseHeaders() + { + + } + } + public partial interface IPortalRevisionUpdateAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IPortalRevisionUpdateAcceptedResponseHeadersInternal + + { + string AzureAsyncOperation { get; set; } + + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionUpdateAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionUpdateAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..95f5a2e80207 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PortalRevisionUpdateAcceptedResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PortalRevisionUpdateAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionUpdateAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionUpdateAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPortalRevisionUpdateAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PortalRevisionUpdateAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PortalRevisionUpdateAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..bed95552ee9a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders() + { + + } + } + public partial interface IPrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IPrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..59002dfc6508 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionCreateOrUpdateAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionDeleteAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionDeleteAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..afa54b3ebd2d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionDeleteAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PrivateEndpointConnectionDeleteAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionDeleteAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionDeleteAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionDeleteAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public PrivateEndpointConnectionDeleteAcceptedResponseHeaders() + { + + } + } + public partial interface IPrivateEndpointConnectionDeleteAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IPrivateEndpointConnectionDeleteAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionDeleteAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionDeleteAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..0e3855fde400 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/PrivateEndpointConnectionDeleteAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class PrivateEndpointConnectionDeleteAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionDeleteAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionDeleteAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IPrivateEndpointConnectionDeleteAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionDeleteAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionDeleteAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..ca5922462795 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ProductGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public ProductGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IProductGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IProductGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..161cc95cf81c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ProductGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..6d989f200fb4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductPolicyGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ProductPolicyGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductPolicyGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductPolicyGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductPolicyGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public ProductPolicyGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IProductPolicyGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IProductPolicyGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..bf259bed8c37 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductPolicyGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ProductPolicyGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductPolicyGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductPolicyGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductPolicyGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductPolicyGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductPolicyGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductWikiGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductWikiGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..a8e0b8a69ccc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductWikiGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ProductWikiGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductWikiGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductWikiGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductWikiGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public ProductWikiGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IProductWikiGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IProductWikiGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductWikiGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductWikiGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9a19acff1540 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/ProductWikiGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class ProductWikiGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductWikiGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductWikiGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IProductWikiGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new ProductWikiGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal ProductWikiGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignInSettingsGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignInSettingsGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..2cb5e0f9da78 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignInSettingsGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class SignInSettingsGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignInSettingsGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignInSettingsGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignInSettingsGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public SignInSettingsGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface ISignInSettingsGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ISignInSettingsGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignInSettingsGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignInSettingsGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..c34c69c6b970 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignInSettingsGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class SignInSettingsGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignInSettingsGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignInSettingsGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignInSettingsGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SignInSettingsGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SignInSettingsGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignUpSettingsGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignUpSettingsGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..8d90a0d53cbf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignUpSettingsGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class SignUpSettingsGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignUpSettingsGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignUpSettingsGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignUpSettingsGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public SignUpSettingsGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface ISignUpSettingsGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ISignUpSettingsGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignUpSettingsGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignUpSettingsGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..4b113353fd2d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SignUpSettingsGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class SignUpSettingsGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignUpSettingsGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignUpSettingsGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISignUpSettingsGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SignUpSettingsGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SignUpSettingsGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/SubscriptionGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SubscriptionGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..6c7d54658787 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SubscriptionGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class SubscriptionGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISubscriptionGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISubscriptionGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISubscriptionGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public SubscriptionGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface ISubscriptionGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ISubscriptionGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/SubscriptionGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SubscriptionGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..a371b3642bb3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/SubscriptionGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class SubscriptionGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISubscriptionGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISubscriptionGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ISubscriptionGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new SubscriptionGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByApiOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByApiOkResponseHeaders.cs new file mode 100644 index 000000000000..811cc2a524dc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByApiOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TagGetEntityStateByApiOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByApiOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByApiOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByApiOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public TagGetEntityStateByApiOkResponseHeaders() + { + + } + } + public partial interface ITagGetEntityStateByApiOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ITagGetEntityStateByApiOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByApiOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByApiOkResponseHeaders.json.cs new file mode 100644 index 000000000000..6c919658dfdb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByApiOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TagGetEntityStateByApiOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByApiOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByApiOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByApiOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagGetEntityStateByApiOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagGetEntityStateByApiOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByOperationOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByOperationOkResponseHeaders.cs new file mode 100644 index 000000000000..2e315c719f9c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByOperationOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TagGetEntityStateByOperationOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByOperationOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByOperationOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByOperationOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public TagGetEntityStateByOperationOkResponseHeaders() + { + + } + } + public partial interface ITagGetEntityStateByOperationOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ITagGetEntityStateByOperationOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByOperationOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByOperationOkResponseHeaders.json.cs new file mode 100644 index 000000000000..e5f86f8b5a5f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByOperationOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TagGetEntityStateByOperationOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByOperationOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByOperationOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByOperationOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagGetEntityStateByOperationOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagGetEntityStateByOperationOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByProductOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByProductOkResponseHeaders.cs new file mode 100644 index 000000000000..4ddece0b63e2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByProductOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TagGetEntityStateByProductOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByProductOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByProductOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByProductOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public TagGetEntityStateByProductOkResponseHeaders() + { + + } + } + public partial interface ITagGetEntityStateByProductOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ITagGetEntityStateByProductOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByProductOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByProductOkResponseHeaders.json.cs new file mode 100644 index 000000000000..86ecabc82880 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateByProductOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TagGetEntityStateByProductOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByProductOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByProductOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateByProductOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagGetEntityStateByProductOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagGetEntityStateByProductOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateOkResponseHeaders.cs new file mode 100644 index 000000000000..da98faebbc40 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TagGetEntityStateOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public TagGetEntityStateOkResponseHeaders() + { + + } + } + public partial interface ITagGetEntityStateOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ITagGetEntityStateOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateOkResponseHeaders.json.cs new file mode 100644 index 000000000000..11b0e78885c3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TagGetEntityStateOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TagGetEntityStateOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITagGetEntityStateOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TagGetEntityStateOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TagGetEntityStateOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantAccessGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantAccessGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..22ccdabd93de --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantAccessGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TenantAccessGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantAccessGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantAccessGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantAccessGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public TenantAccessGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface ITenantAccessGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface ITenantAccessGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantAccessGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantAccessGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..011b14756c73 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantAccessGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TenantAccessGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantAccessGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantAccessGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantAccessGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TenantAccessGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TenantAccessGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationDeployAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationDeployAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..adac655c175a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationDeployAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TenantConfigurationDeployAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationDeployAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationDeployAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationDeployAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public TenantConfigurationDeployAcceptedResponseHeaders() + { + + } + } + public partial interface ITenantConfigurationDeployAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface ITenantConfigurationDeployAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationDeployAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationDeployAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..7d782d5dd03f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationDeployAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TenantConfigurationDeployAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationDeployAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationDeployAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationDeployAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TenantConfigurationDeployAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TenantConfigurationDeployAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationSaveAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationSaveAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..796d155f3ba3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationSaveAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TenantConfigurationSaveAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationSaveAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationSaveAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationSaveAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public TenantConfigurationSaveAcceptedResponseHeaders() + { + + } + } + public partial interface ITenantConfigurationSaveAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface ITenantConfigurationSaveAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationSaveAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationSaveAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..531477cdbff1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationSaveAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TenantConfigurationSaveAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationSaveAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationSaveAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationSaveAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TenantConfigurationSaveAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TenantConfigurationSaveAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationValidateAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationValidateAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..ad85e196cad3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationValidateAcceptedResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TenantConfigurationValidateAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationValidateAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationValidateAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationValidateAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public TenantConfigurationValidateAcceptedResponseHeaders() + { + + } + } + public partial interface ITenantConfigurationValidateAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface ITenantConfigurationValidateAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationValidateAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationValidateAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..a5b2a048db4a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/TenantConfigurationValidateAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class TenantConfigurationValidateAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationValidateAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationValidateAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.ITenantConfigurationValidateAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new TenantConfigurationValidateAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal TenantConfigurationValidateAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserDeleteAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserDeleteAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..32307b46380b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserDeleteAcceptedResponseHeaders.cs @@ -0,0 +1,75 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class UserDeleteAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserDeleteAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserDeleteAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserDeleteAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserDeleteAcceptedResponseHeadersInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader1) is string __headerAzureAsyncOperationHeader1 ? __headerAzureAsyncOperationHeader1 : (string)null; + } + } + + /// Creates an new instance. + public UserDeleteAcceptedResponseHeaders() + { + + } + } + public partial interface IUserDeleteAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IUserDeleteAcceptedResponseHeadersInternal + + { + string AzureAsyncOperation { get; set; } + + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserDeleteAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserDeleteAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..0e048ee54d70 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserDeleteAcceptedResponseHeaders.json.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class UserDeleteAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserDeleteAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserDeleteAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserDeleteAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserDeleteAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserDeleteAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..8af7ea59faf0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class UserGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public UserGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IUserGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IUserGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..96c4314243a1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/UserGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class UserGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IUserGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new UserGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal UserGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..c393771f1f71 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceApiGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceApiGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceApiGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..2c90f3cb5199 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceApiGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceApiGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..7b558f7316bf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiOperationGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceApiOperationGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceApiOperationGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceApiOperationGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..d66266c56dea --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiOperationGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceApiOperationGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceApiOperationGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..886e2cb6382d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationPolicyGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationPolicyGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceApiOperationPolicyGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..61632e6d2eee --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceApiOperationPolicyGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..ed281fb205fd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiPolicyGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiPolicyGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiPolicyGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiPolicyGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiPolicyGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceApiPolicyGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceApiPolicyGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceApiPolicyGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..27113cf038a6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiPolicyGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiPolicyGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiPolicyGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiPolicyGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiPolicyGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceApiPolicyGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceApiPolicyGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiReleaseGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiReleaseGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..da352846d7f7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiReleaseGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiReleaseGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiReleaseGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiReleaseGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiReleaseGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceApiReleaseGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceApiReleaseGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceApiReleaseGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiReleaseGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiReleaseGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9ec1bc5fff48 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiReleaseGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiReleaseGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiReleaseGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiReleaseGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiReleaseGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceApiReleaseGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceApiReleaseGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiSchemaGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiSchemaGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..87ae4b8ae9be --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiSchemaGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiSchemaGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiSchemaGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiSchemaGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiSchemaGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceApiSchemaGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceApiSchemaGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceApiSchemaGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiSchemaGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiSchemaGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..42b94f7cfacd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiSchemaGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiSchemaGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiSchemaGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiSchemaGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiSchemaGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceApiSchemaGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceApiSchemaGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiVersionSetGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiVersionSetGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..8c809ddac518 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiVersionSetGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiVersionSetGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiVersionSetGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiVersionSetGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiVersionSetGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceApiVersionSetGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceApiVersionSetGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceApiVersionSetGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiVersionSetGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiVersionSetGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..d46035b3bbd3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceApiVersionSetGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceApiVersionSetGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiVersionSetGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiVersionSetGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceApiVersionSetGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceApiVersionSetGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceApiVersionSetGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..4675f8c7e276 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,55 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Creates an new instance. + public WorkspaceGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..2db820d81cd3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..56eab381a2db --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGlobalSchemaGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGlobalSchemaGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGlobalSchemaGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceGlobalSchemaGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceGlobalSchemaGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..d6b1e44341d8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGlobalSchemaGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGlobalSchemaGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGlobalSchemaGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceGlobalSchemaGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGroupGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGroupGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..ed01f1579507 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGroupGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceGroupGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGroupGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGroupGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGroupGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceGroupGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceGroupGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceGroupGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGroupGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGroupGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..179edce6bf5a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceGroupGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceGroupGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGroupGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGroupGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceGroupGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceGroupGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceGroupGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..c0dd4c11f089 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceNamedValueGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceNamedValueGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceNamedValueGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceNamedValueGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..f54278041fca --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceNamedValueGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceNamedValueGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceNamedValueGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..224de46514fb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders.cs @@ -0,0 +1,77 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueRefreshSecretAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueRefreshSecretAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueRefreshSecretAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueRefreshSecretAcceptedResponseHeadersInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader1) is string __headerAzureAsyncOperationHeader1 ? __headerAzureAsyncOperationHeader1 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders() + { + + } + } + public partial interface IWorkspaceNamedValueRefreshSecretAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IWorkspaceNamedValueRefreshSecretAcceptedResponseHeadersInternal + + { + string AzureAsyncOperation { get; set; } + + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..145d50fc8793 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueRefreshSecretAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueRefreshSecretAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueRefreshSecretAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceNamedValueRefreshSecretAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueUpdateAcceptedResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueUpdateAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..08ec5999e70e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueUpdateAcceptedResponseHeaders.cs @@ -0,0 +1,77 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceNamedValueUpdateAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueUpdateAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueUpdateAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueUpdateAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueUpdateAcceptedResponseHeadersInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader1) is string __headerAzureAsyncOperationHeader1 ? __headerAzureAsyncOperationHeader1 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceNamedValueUpdateAcceptedResponseHeaders() + { + + } + } + public partial interface IWorkspaceNamedValueUpdateAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IWorkspaceNamedValueUpdateAcceptedResponseHeadersInternal + + { + string AzureAsyncOperation { get; set; } + + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueUpdateAcceptedResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueUpdateAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..9809ce7740c5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceNamedValueUpdateAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceNamedValueUpdateAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueUpdateAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueUpdateAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceNamedValueUpdateAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceNamedValueUpdateAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceNamedValueUpdateAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyFragmentGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyFragmentGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..f076e1dc9e2e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyFragmentGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspacePolicyFragmentGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyFragmentGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyFragmentGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyFragmentGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspacePolicyFragmentGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspacePolicyFragmentGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspacePolicyFragmentGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyFragmentGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyFragmentGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..9871d37a0df3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyFragmentGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspacePolicyFragmentGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyFragmentGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyFragmentGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyFragmentGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspacePolicyFragmentGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspacePolicyFragmentGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..47671bdd9841 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspacePolicyGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspacePolicyGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspacePolicyGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspacePolicyGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..861e850ac10a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspacePolicyGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspacePolicyGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspacePolicyGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspacePolicyGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspacePolicyGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..e73990334b7a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceProductGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceProductGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceProductGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceProductGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..56ed949261d7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceProductGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceProductGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceProductGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductPolicyGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductPolicyGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..26c110c86696 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductPolicyGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceProductPolicyGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductPolicyGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductPolicyGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductPolicyGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceProductPolicyGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceProductPolicyGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceProductPolicyGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductPolicyGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductPolicyGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..a14b03d3a5f0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceProductPolicyGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceProductPolicyGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductPolicyGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductPolicyGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceProductPolicyGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceProductPolicyGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceProductPolicyGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceSubscriptionGetEntityTagOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceSubscriptionGetEntityTagOkResponseHeaders.cs new file mode 100644 index 000000000000..7318964864e7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceSubscriptionGetEntityTagOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceSubscriptionGetEntityTagOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceSubscriptionGetEntityTagOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceSubscriptionGetEntityTagOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceSubscriptionGetEntityTagOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceSubscriptionGetEntityTagOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceSubscriptionGetEntityTagOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceSubscriptionGetEntityTagOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceSubscriptionGetEntityTagOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceSubscriptionGetEntityTagOkResponseHeaders.json.cs new file mode 100644 index 000000000000..c75d95b9f2c6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceSubscriptionGetEntityTagOkResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceSubscriptionGetEntityTagOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceSubscriptionGetEntityTagOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceSubscriptionGetEntityTagOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceSubscriptionGetEntityTagOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceSubscriptionGetEntityTagOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceSubscriptionGetEntityTagOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceTagGetEntityStateOkResponseHeaders.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceTagGetEntityStateOkResponseHeaders.cs new file mode 100644 index 000000000000..6c204525125c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceTagGetEntityStateOkResponseHeaders.cs @@ -0,0 +1,57 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceTagGetEntityStateOkResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceTagGetEntityStateOkResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceTagGetEntityStateOkResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Api.Origin(Microsoft.Azure.PowerShell.Cmdlets.Api.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceTagGetEntityStateOkResponseHeadersInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public WorkspaceTagGetEntityStateOkResponseHeaders() + { + + } + } + public partial interface IWorkspaceTagGetEntityStateOkResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + + } + internal partial interface IWorkspaceTagGetEntityStateOkResponseHeadersInternal + + { + string ETag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceTagGetEntityStateOkResponseHeaders.json.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceTagGetEntityStateOkResponseHeaders.json.cs new file mode 100644 index 000000000000..99737953716f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Models/WorkspaceTagGetEntityStateOkResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public partial class WorkspaceTagGetEntityStateOkResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceTagGetEntityStateOkResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceTagGetEntityStateOkResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.IWorkspaceTagGetEntityStateOkResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new WorkspaceTagGetEntityStateOkResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from. + internal WorkspaceTagGetEntityStateOkResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/AccessIdName.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AccessIdName.cs new file mode 100644 index 000000000000..adb2f59591c6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AccessIdName.cs @@ -0,0 +1,97 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct AccessIdName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName Access = @"access"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName GitAccess = @"gitAccess"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AccessIdName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AccessIdName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AccessIdName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AccessIdName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AccessIdName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AccessIdName && Equals((AccessIdName)obj); + } + + /// Returns hashCode for enum AccessIdName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AccessIdName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AccessIdName + /// the value to convert to an instance of . + + public static implicit operator AccessIdName(string value) + { + return new AccessIdName(value); + } + + /// Implicit operator to convert AccessIdName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName e) + { + return e._value; + } + + /// Overriding != operator for enum AccessIdName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AccessIdName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessIdName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/AccessType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AccessType.cs new file mode 100644 index 000000000000..e433b8000ecf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AccessType.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The type of access to be used for the storage account. + public partial struct AccessType : + System.IEquatable + { + /// Use access key. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType AccessKey = @"AccessKey"; + + /// Use system assigned managed identity. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType SystemAssignedManagedIdentity = @"SystemAssignedManagedIdentity"; + + /// Use user assigned managed identity. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType UserAssignedManagedIdentity = @"UserAssignedManagedIdentity"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AccessType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AccessType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AccessType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AccessType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AccessType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AccessType && Equals((AccessType)obj); + } + + /// Returns hashCode for enum AccessType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AccessType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AccessType + /// the value to convert to an instance of . + + public static implicit operator AccessType(string value) + { + return new AccessType(value); + } + + /// Implicit operator to convert AccessType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType e) + { + return e._value; + } + + /// Overriding != operator for enum AccessType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AccessType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AccessType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/AlwaysLog.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AlwaysLog.cs new file mode 100644 index 000000000000..179be8cbd1ff --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AlwaysLog.cs @@ -0,0 +1,97 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Specifies for what type of messages sampling settings should not apply. + public partial struct AlwaysLog : + System.IEquatable + { + /// Always log all erroneous request regardless of sampling settings. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog AllErrors = @"allErrors"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AlwaysLog(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AlwaysLog + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AlwaysLog(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AlwaysLog + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AlwaysLog (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AlwaysLog && Equals((AlwaysLog)obj); + } + + /// Returns hashCode for enum AlwaysLog + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AlwaysLog + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AlwaysLog + /// the value to convert to an instance of . + + public static implicit operator AlwaysLog(string value) + { + return new AlwaysLog(value); + } + + /// Implicit operator to convert AlwaysLog to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog e) + { + return e._value; + } + + /// Overriding != operator for enum AlwaysLog + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AlwaysLog + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AlwaysLog e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiManagementSkuCapacityScaleType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiManagementSkuCapacityScaleType.cs new file mode 100644 index 000000000000..16a231b1542e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiManagementSkuCapacityScaleType.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The scale type applicable to the sku. + public partial struct ApiManagementSkuCapacityScaleType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType Automatic = @"Automatic"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType Manual = @"Manual"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType None = @"None"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private ApiManagementSkuCapacityScaleType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ApiManagementSkuCapacityScaleType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ApiManagementSkuCapacityScaleType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ApiManagementSkuCapacityScaleType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type ApiManagementSkuCapacityScaleType (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ApiManagementSkuCapacityScaleType && Equals((ApiManagementSkuCapacityScaleType)obj); + } + + /// Returns hashCode for enum ApiManagementSkuCapacityScaleType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ApiManagementSkuCapacityScaleType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ApiManagementSkuCapacityScaleType + /// the value to convert to an instance of . + + public static implicit operator ApiManagementSkuCapacityScaleType(string value) + { + return new ApiManagementSkuCapacityScaleType(value); + } + + /// Implicit operator to convert ApiManagementSkuCapacityScaleType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType e) + { + return e._value; + } + + /// Overriding != operator for enum ApiManagementSkuCapacityScaleType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ApiManagementSkuCapacityScaleType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuCapacityScaleType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiManagementSkuRestrictionsReasonCode.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiManagementSkuRestrictionsReasonCode.cs new file mode 100644 index 000000000000..ee0600eb5bc6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiManagementSkuRestrictionsReasonCode.cs @@ -0,0 +1,104 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The reason for restriction. + public partial struct ApiManagementSkuRestrictionsReasonCode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode NotAvailableForSubscription = @"NotAvailableForSubscription"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode QuotaId = @"QuotaId"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private ApiManagementSkuRestrictionsReasonCode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ApiManagementSkuRestrictionsReasonCode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ApiManagementSkuRestrictionsReasonCode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ApiManagementSkuRestrictionsReasonCode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type ApiManagementSkuRestrictionsReasonCode (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ApiManagementSkuRestrictionsReasonCode && Equals((ApiManagementSkuRestrictionsReasonCode)obj); + } + + /// Returns hashCode for enum ApiManagementSkuRestrictionsReasonCode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ApiManagementSkuRestrictionsReasonCode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ApiManagementSkuRestrictionsReasonCode + /// the value to convert to an instance of . + + public static implicit operator ApiManagementSkuRestrictionsReasonCode(string value) + { + return new ApiManagementSkuRestrictionsReasonCode(value); + } + + /// Implicit operator to convert ApiManagementSkuRestrictionsReasonCode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode e) + { + return e._value; + } + + /// Overriding != operator for enum ApiManagementSkuRestrictionsReasonCode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ApiManagementSkuRestrictionsReasonCode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsReasonCode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiManagementSkuRestrictionsType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiManagementSkuRestrictionsType.cs new file mode 100644 index 000000000000..e60dafe5d315 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiManagementSkuRestrictionsType.cs @@ -0,0 +1,104 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The type of restrictions. + public partial struct ApiManagementSkuRestrictionsType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType Location = @"Location"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType Zone = @"Zone"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private ApiManagementSkuRestrictionsType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ApiManagementSkuRestrictionsType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ApiManagementSkuRestrictionsType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ApiManagementSkuRestrictionsType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type ApiManagementSkuRestrictionsType (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ApiManagementSkuRestrictionsType && Equals((ApiManagementSkuRestrictionsType)obj); + } + + /// Returns hashCode for enum ApiManagementSkuRestrictionsType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ApiManagementSkuRestrictionsType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ApiManagementSkuRestrictionsType + /// the value to convert to an instance of . + + public static implicit operator ApiManagementSkuRestrictionsType(string value) + { + return new ApiManagementSkuRestrictionsType(value); + } + + /// Implicit operator to convert ApiManagementSkuRestrictionsType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType e) + { + return e._value; + } + + /// Overriding != operator for enum ApiManagementSkuRestrictionsType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ApiManagementSkuRestrictionsType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiManagementSkuRestrictionsType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiType.cs new file mode 100644 index 000000000000..53f2510bf8aa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApiType.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Type of API. + public partial struct ApiType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType Graphql = @"graphql"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType Grpc = @"grpc"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType Http = @"http"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType Odata = @"odata"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType Soap = @"soap"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType Websocket = @"websocket"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ApiType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ApiType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ApiType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ApiType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ApiType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ApiType && Equals((ApiType)obj); + } + + /// Returns hashCode for enum ApiType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ApiType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ApiType + /// the value to convert to an instance of . + + public static implicit operator ApiType(string value) + { + return new ApiType(value); + } + + /// Implicit operator to convert ApiType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType e) + { + return e._value; + } + + /// Overriding != operator for enum ApiType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ApiType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApiType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApimIdentityType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApimIdentityType.cs new file mode 100644 index 000000000000..3695711d7785 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ApimIdentityType.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// + public partial struct ApimIdentityType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType SystemAssigned = @"SystemAssigned"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType SystemAssignedUserAssigned = @"SystemAssigned, UserAssigned"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType UserAssigned = @"UserAssigned"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ApimIdentityType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ApimIdentityType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ApimIdentityType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ApimIdentityType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ApimIdentityType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ApimIdentityType && Equals((ApimIdentityType)obj); + } + + /// Returns hashCode for enum ApimIdentityType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ApimIdentityType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ApimIdentityType + /// the value to convert to an instance of . + + public static implicit operator ApimIdentityType(string value) + { + return new ApimIdentityType(value); + } + + /// Implicit operator to convert ApimIdentityType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType e) + { + return e._value; + } + + /// Overriding != operator for enum ApimIdentityType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ApimIdentityType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ApimIdentityType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/AppType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AppType.cs new file mode 100644 index 000000000000..2eb786245a50 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AppType.cs @@ -0,0 +1,99 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct AppType : + System.IEquatable + { + /// User create request was sent by new developer portal. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType DeveloperPortal = @"developerPortal"; + + /// User create request was sent by legacy developer portal. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType Portal = @"portal"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AppType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AppType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AppType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AppType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AppType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AppType && Equals((AppType)obj); + } + + /// Returns hashCode for enum AppType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AppType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AppType + /// the value to convert to an instance of . + + public static implicit operator AppType(string value) + { + return new AppType(value); + } + + /// Implicit operator to convert AppType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType e) + { + return e._value; + } + + /// Overriding != operator for enum AppType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AppType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AppType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/AsyncOperationStatus.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AsyncOperationStatus.cs new file mode 100644 index 000000000000..ec988e9bdfb9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AsyncOperationStatus.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Status of an async operation. + public partial struct AsyncOperationStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus Started = @"Started"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AsyncOperationStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AsyncOperationStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AsyncOperationStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AsyncOperationStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AsyncOperationStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AsyncOperationStatus && Equals((AsyncOperationStatus)obj); + } + + /// Returns hashCode for enum AsyncOperationStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AsyncOperationStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AsyncOperationStatus + /// the value to convert to an instance of . + + public static implicit operator AsyncOperationStatus(string value) + { + return new AsyncOperationStatus(value); + } + + /// Implicit operator to convert AsyncOperationStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus e) + { + return e._value; + } + + /// Overriding != operator for enum AsyncOperationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AsyncOperationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncOperationStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/AsyncResolverStatus.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AsyncResolverStatus.cs new file mode 100644 index 000000000000..6db73b838fdd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AsyncResolverStatus.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Status of an async resolver. + public partial struct AsyncResolverStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus Started = @"Started"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AsyncResolverStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AsyncResolverStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AsyncResolverStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AsyncResolverStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AsyncResolverStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AsyncResolverStatus && Equals((AsyncResolverStatus)obj); + } + + /// Returns hashCode for enum AsyncResolverStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AsyncResolverStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AsyncResolverStatus + /// the value to convert to an instance of . + + public static implicit operator AsyncResolverStatus(string value) + { + return new AsyncResolverStatus(value); + } + + /// Implicit operator to convert AsyncResolverStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus e) + { + return e._value; + } + + /// Overriding != operator for enum AsyncResolverStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AsyncResolverStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AsyncResolverStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/AuthorizationMethod.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AuthorizationMethod.cs new file mode 100644 index 000000000000..fece50cc382f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AuthorizationMethod.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct AuthorizationMethod : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod Delete = @"DELETE"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod Get = @"GET"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod Head = @"HEAD"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod Options = @"OPTIONS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod Patch = @"PATCH"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod Post = @"POST"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod Put = @"PUT"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod Trace = @"TRACE"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AuthorizationMethod(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AuthorizationMethod + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AuthorizationMethod(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AuthorizationMethod + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AuthorizationMethod (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AuthorizationMethod && Equals((AuthorizationMethod)obj); + } + + /// Returns hashCode for enum AuthorizationMethod + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AuthorizationMethod + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AuthorizationMethod + /// the value to convert to an instance of . + + public static implicit operator AuthorizationMethod(string value) + { + return new AuthorizationMethod(value); + } + + /// Implicit operator to convert AuthorizationMethod to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod e) + { + return e._value; + } + + /// Overriding != operator for enum AuthorizationMethod + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AuthorizationMethod + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationMethod e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/AuthorizationType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AuthorizationType.cs new file mode 100644 index 000000000000..47b5cb72ff75 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/AuthorizationType.cs @@ -0,0 +1,97 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Authorization type options + public partial struct AuthorizationType : + System.IEquatable + { + /// OAuth2 authorization type + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType OAuth2 = @"OAuth2"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AuthorizationType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AuthorizationType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AuthorizationType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AuthorizationType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AuthorizationType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AuthorizationType && Equals((AuthorizationType)obj); + } + + /// Returns hashCode for enum AuthorizationType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AuthorizationType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AuthorizationType + /// the value to convert to an instance of . + + public static implicit operator AuthorizationType(string value) + { + return new AuthorizationType(value); + } + + /// Implicit operator to convert AuthorizationType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType e) + { + return e._value; + } + + /// Overriding != operator for enum AuthorizationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AuthorizationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.AuthorizationType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/BackendProtocol.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/BackendProtocol.cs new file mode 100644 index 000000000000..2bc183a084f3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/BackendProtocol.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Backend communication protocol. + public partial struct BackendProtocol : + System.IEquatable + { + /// The Backend is a RESTful service. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol Http = @"http"; + + /// The Backend is a SOAP service. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol Soap = @"soap"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private BackendProtocol(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BackendProtocol + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BackendProtocol(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BackendProtocol + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BackendProtocol (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BackendProtocol && Equals((BackendProtocol)obj); + } + + /// Returns hashCode for enum BackendProtocol + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BackendProtocol + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BackendProtocol + /// the value to convert to an instance of . + + public static implicit operator BackendProtocol(string value) + { + return new BackendProtocol(value); + } + + /// Implicit operator to convert BackendProtocol to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol e) + { + return e._value; + } + + /// Overriding != operator for enum BackendProtocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BackendProtocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendProtocol e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/BackendType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/BackendType.cs new file mode 100644 index 000000000000..eaa0c3d43366 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/BackendType.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Type of the backend. A backend can be either Single or Pool. + public partial struct BackendType : + System.IEquatable + { + /// supports pool backend + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType Pool = @"Pool"; + + /// supports single backend + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType Single = @"Single"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private BackendType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BackendType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BackendType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BackendType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BackendType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BackendType && Equals((BackendType)obj); + } + + /// Returns hashCode for enum BackendType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BackendType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BackendType + /// the value to convert to an instance of . + + public static implicit operator BackendType(string value) + { + return new BackendType(value); + } + + /// Implicit operator to convert BackendType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType e) + { + return e._value; + } + + /// Overriding != operator for enum BackendType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BackendType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BackendType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/BearerTokenSendingMethod.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/BearerTokenSendingMethod.cs new file mode 100644 index 000000000000..3fd7b00d9380 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/BearerTokenSendingMethod.cs @@ -0,0 +1,97 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct BearerTokenSendingMethod : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod AuthorizationHeader = @"authorizationHeader"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod Query = @"query"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private BearerTokenSendingMethod(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BearerTokenSendingMethod + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BearerTokenSendingMethod(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BearerTokenSendingMethod + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BearerTokenSendingMethod (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BearerTokenSendingMethod && Equals((BearerTokenSendingMethod)obj); + } + + /// Returns hashCode for enum BearerTokenSendingMethod + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BearerTokenSendingMethod + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BearerTokenSendingMethod + /// the value to convert to an instance of . + + public static implicit operator BearerTokenSendingMethod(string value) + { + return new BearerTokenSendingMethod(value); + } + + /// Implicit operator to convert BearerTokenSendingMethod to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod e) + { + return e._value; + } + + /// Overriding != operator for enum BearerTokenSendingMethod + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BearerTokenSendingMethod + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethod e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/BearerTokenSendingMethods.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/BearerTokenSendingMethods.cs new file mode 100644 index 000000000000..26a8facaff8e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/BearerTokenSendingMethods.cs @@ -0,0 +1,104 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Form of an authorization grant, which the client uses to request the access token. + /// + public partial struct BearerTokenSendingMethods : + System.IEquatable + { + /// + /// Access token will be transmitted in the Authorization header using Bearer schema + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods AuthorizationHeader = @"authorizationHeader"; + + /// Access token will be transmitted as query parameters. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods Query = @"query"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private BearerTokenSendingMethods(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BearerTokenSendingMethods + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BearerTokenSendingMethods(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BearerTokenSendingMethods + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BearerTokenSendingMethods (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BearerTokenSendingMethods && Equals((BearerTokenSendingMethods)obj); + } + + /// Returns hashCode for enum BearerTokenSendingMethods + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BearerTokenSendingMethods + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BearerTokenSendingMethods + /// the value to convert to an instance of . + + public static implicit operator BearerTokenSendingMethods(string value) + { + return new BearerTokenSendingMethods(value); + } + + /// Implicit operator to convert BearerTokenSendingMethods to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods e) + { + return e._value; + } + + /// Overriding != operator for enum BearerTokenSendingMethods + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BearerTokenSendingMethods + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.BearerTokenSendingMethods e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/CertificateSource.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/CertificateSource.cs new file mode 100644 index 000000000000..3ede40d11ff3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/CertificateSource.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Certificate Source. + public partial struct CertificateSource : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource BuiltIn = @"BuiltIn"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource Custom = @"Custom"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource KeyVault = @"KeyVault"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource Managed = @"Managed"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private CertificateSource(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to CertificateSource + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CertificateSource(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type CertificateSource + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CertificateSource (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CertificateSource && Equals((CertificateSource)obj); + } + + /// Returns hashCode for enum CertificateSource + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CertificateSource + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CertificateSource + /// the value to convert to an instance of . + + public static implicit operator CertificateSource(string value) + { + return new CertificateSource(value); + } + + /// Implicit operator to convert CertificateSource to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource e) + { + return e._value; + } + + /// Overriding != operator for enum CertificateSource + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CertificateSource + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateSource e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/CertificateStatus.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/CertificateStatus.cs new file mode 100644 index 000000000000..96178da9601c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/CertificateStatus.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Certificate Status. + public partial struct CertificateStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus InProgress = @"InProgress"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private CertificateStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to CertificateStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CertificateStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type CertificateStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CertificateStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CertificateStatus && Equals((CertificateStatus)obj); + } + + /// Returns hashCode for enum CertificateStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CertificateStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CertificateStatus + /// the value to convert to an instance of . + + public static implicit operator CertificateStatus(string value) + { + return new CertificateStatus(value); + } + + /// Implicit operator to convert CertificateStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus e) + { + return e._value; + } + + /// Overriding != operator for enum CertificateStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CertificateStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CertificateStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ClientAuthenticationMethod.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ClientAuthenticationMethod.cs new file mode 100644 index 000000000000..34f15e511b63 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ClientAuthenticationMethod.cs @@ -0,0 +1,101 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct ClientAuthenticationMethod : + System.IEquatable + { + /// Basic Client Authentication method. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod Basic = @"Basic"; + + /// Body based Authentication method. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod Body = @"Body"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ClientAuthenticationMethod(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ClientAuthenticationMethod + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ClientAuthenticationMethod(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ClientAuthenticationMethod + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ClientAuthenticationMethod (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ClientAuthenticationMethod && Equals((ClientAuthenticationMethod)obj); + } + + /// Returns hashCode for enum ClientAuthenticationMethod + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ClientAuthenticationMethod + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ClientAuthenticationMethod + /// the value to convert to an instance of . + + public static implicit operator ClientAuthenticationMethod(string value) + { + return new ClientAuthenticationMethod(value); + } + + /// Implicit operator to convert ClientAuthenticationMethod to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod e) + { + return e._value; + } + + /// Overriding != operator for enum ClientAuthenticationMethod + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ClientAuthenticationMethod + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ClientAuthenticationMethod e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConfigurationIdName.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConfigurationIdName.cs new file mode 100644 index 000000000000..5d5e6c4adc7b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConfigurationIdName.cs @@ -0,0 +1,95 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct ConfigurationIdName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName Configuration = @"configuration"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ConfigurationIdName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ConfigurationIdName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ConfigurationIdName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ConfigurationIdName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ConfigurationIdName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ConfigurationIdName && Equals((ConfigurationIdName)obj); + } + + /// Returns hashCode for enum ConfigurationIdName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ConfigurationIdName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ConfigurationIdName + /// the value to convert to an instance of . + + public static implicit operator ConfigurationIdName(string value) + { + return new ConfigurationIdName(value); + } + + /// Implicit operator to convert ConfigurationIdName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName e) + { + return e._value; + } + + /// Overriding != operator for enum ConfigurationIdName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ConfigurationIdName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConfigurationIdName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/Confirmation.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Confirmation.cs new file mode 100644 index 000000000000..a45269de12e5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Confirmation.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Determines the type of confirmation e-mail that will be sent to the newly created user. + /// + public partial struct Confirmation : + System.IEquatable + { + /// Send an e-mail inviting the user to sign-up and complete registration. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation Invite = @"invite"; + + /// Send an e-mail to the user confirming they have successfully signed up. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation Signup = @"signup"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Confirmation(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to Confirmation + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Confirmation(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Confirmation + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Confirmation (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Confirmation && Equals((Confirmation)obj); + } + + /// Returns hashCode for enum Confirmation + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Confirmation + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Confirmation + /// the value to convert to an instance of . + + public static implicit operator Confirmation(string value) + { + return new Confirmation(value); + } + + /// Implicit operator to convert Confirmation to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation e) + { + return e._value; + } + + /// Overriding != operator for enum Confirmation + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Confirmation + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Confirmation e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConnectionStatus.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConnectionStatus.cs new file mode 100644 index 000000000000..94578db8ec30 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConnectionStatus.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The connection status. + public partial struct ConnectionStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus Connected = @"Connected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus Degraded = @"Degraded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus Disconnected = @"Disconnected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus Unknown = @"Unknown"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ConnectionStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ConnectionStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ConnectionStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ConnectionStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ConnectionStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ConnectionStatus && Equals((ConnectionStatus)obj); + } + + /// Returns hashCode for enum ConnectionStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ConnectionStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ConnectionStatus + /// the value to convert to an instance of . + + public static implicit operator ConnectionStatus(string value) + { + return new ConnectionStatus(value); + } + + /// Implicit operator to convert ConnectionStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConnectivityCheckProtocol.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConnectivityCheckProtocol.cs new file mode 100644 index 000000000000..b01dfcec820e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConnectivityCheckProtocol.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination + /// address must be coherent with this value. + /// + public partial struct ConnectivityCheckProtocol : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol Http = @"HTTP"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol Https = @"HTTPS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol Tcp = @"TCP"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ConnectivityCheckProtocol(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ConnectivityCheckProtocol + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ConnectivityCheckProtocol(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ConnectivityCheckProtocol + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ConnectivityCheckProtocol (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ConnectivityCheckProtocol && Equals((ConnectivityCheckProtocol)obj); + } + + /// Returns hashCode for enum ConnectivityCheckProtocol + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ConnectivityCheckProtocol + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ConnectivityCheckProtocol + /// the value to convert to an instance of . + + public static implicit operator ConnectivityCheckProtocol(string value) + { + return new ConnectivityCheckProtocol(value); + } + + /// Implicit operator to convert ConnectivityCheckProtocol to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol e) + { + return e._value; + } + + /// Overriding != operator for enum ConnectivityCheckProtocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ConnectivityCheckProtocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityCheckProtocol e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConnectivityStatusType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConnectivityStatusType.cs new file mode 100644 index 000000000000..01f204290e40 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ConnectivityStatusType.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Resource Connectivity Status Type identifier. + public partial struct ConnectivityStatusType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType Failure = @"failure"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType Initializing = @"initializing"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType Success = @"success"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ConnectivityStatusType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ConnectivityStatusType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ConnectivityStatusType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ConnectivityStatusType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ConnectivityStatusType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ConnectivityStatusType && Equals((ConnectivityStatusType)obj); + } + + /// Returns hashCode for enum ConnectivityStatusType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ConnectivityStatusType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ConnectivityStatusType + /// the value to convert to an instance of . + + public static implicit operator ConnectivityStatusType(string value) + { + return new ConnectivityStatusType(value); + } + + /// Implicit operator to convert ConnectivityStatusType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType e) + { + return e._value; + } + + /// Overriding != operator for enum ConnectivityStatusType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ConnectivityStatusType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ConnectivityStatusType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ContentFormat.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ContentFormat.cs new file mode 100644 index 000000000000..2c59cc9b7995 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ContentFormat.cs @@ -0,0 +1,147 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Format of the Content in which the API is getting imported. New formats can be added in the future + /// + public partial struct ContentFormat : + System.IEquatable + { + /// The GraphQL API endpoint hosted on a publicly accessible internet address. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat GraphqlLink = @"graphql-link"; + + /// The contents are inline and Content Type is a gRPC protobuf file. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat Grpc = @"grpc"; + + /// The gRPC protobuf file is hosted on a publicly accessible internet address. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat GrpcLink = @"grpc-link"; + + /// The contents are inline and Content Type is a OData XML Document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat Odata = @"odata"; + + /// The OData metadata document hosted on a publicly accessible internet address. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat OdataLink = @"odata-link"; + + /// The contents are inline and Content Type is a OpenAPI 3.0 YAML Document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat Openapi = @"openapi"; + + /// The contents are inline and Content Type is a OpenAPI 3.0 JSON Document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat OpenapiJson = @"openapi+json"; + + /// + /// The OpenAPI 3.0 JSON document is hosted on a publicly accessible internet address. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat OpenapiJsonLink = @"openapi+json-link"; + + /// + /// The OpenAPI 3.0 YAML document is hosted on a publicly accessible internet address. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat OpenapiLink = @"openapi-link"; + + /// The contents are inline and Content Type is a OpenAPI 2.0 JSON Document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat SwaggerJson = @"swagger-json"; + + /// + /// The OpenAPI 2.0 JSON document is hosted on a publicly accessible internet address. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat SwaggerLinkJson = @"swagger-link-json"; + + /// The WADL document is hosted on a publicly accessible internet address. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat WadlLinkJson = @"wadl-link-json"; + + /// The contents are inline and Content type is a WADL document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat WadlXml = @"wadl-xml"; + + /// The contents are inline and the document is a WSDL/Soap document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat Wsdl = @"wsdl"; + + /// The WSDL document is hosted on a publicly accessible internet address. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat WsdlLink = @"wsdl-link"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ContentFormat(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ContentFormat + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ContentFormat(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ContentFormat + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ContentFormat (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ContentFormat && Equals((ContentFormat)obj); + } + + /// Returns hashCode for enum ContentFormat + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ContentFormat + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ContentFormat + /// the value to convert to an instance of . + + public static implicit operator ContentFormat(string value) + { + return new ContentFormat(value); + } + + /// Implicit operator to convert ContentFormat to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat e) + { + return e._value; + } + + /// Overriding != operator for enum ContentFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ContentFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ContentFormat e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/CreatedByType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/CreatedByType.cs new file mode 100644 index 000000000000..fb72049c85ec --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/CreatedByType.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The type of identity that created the resource. + public partial struct CreatedByType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType Application = @"Application"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType Key = @"Key"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType User = @"User"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to CreatedByType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CreatedByType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private CreatedByType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type CreatedByType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CreatedByType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CreatedByType && Equals((CreatedByType)obj); + } + + /// Returns hashCode for enum CreatedByType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CreatedByType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CreatedByType + /// the value to convert to an instance of . + + public static implicit operator CreatedByType(string value) + { + return new CreatedByType(value); + } + + /// Implicit operator to convert CreatedByType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType e) + { + return e._value; + } + + /// Overriding != operator for enum CreatedByType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CreatedByType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.CreatedByType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/DataMaskingMode.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/DataMaskingMode.cs new file mode 100644 index 000000000000..69d61ed7ebda --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/DataMaskingMode.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Data masking mode. + public partial struct DataMaskingMode : + System.IEquatable + { + /// Hide the presence of an entity. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode Hide = @"Hide"; + + /// Mask the value of an entity. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode Mask = @"Mask"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DataMaskingMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DataMaskingMode(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DataMaskingMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DataMaskingMode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DataMaskingMode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DataMaskingMode && Equals((DataMaskingMode)obj); + } + + /// Returns hashCode for enum DataMaskingMode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DataMaskingMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DataMaskingMode + /// the value to convert to an instance of . + + public static implicit operator DataMaskingMode(string value) + { + return new DataMaskingMode(value); + } + + /// Implicit operator to convert DataMaskingMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode e) + { + return e._value; + } + + /// Overriding != operator for enum DataMaskingMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DataMaskingMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DataMaskingMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/DeveloperPortalStatus.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/DeveloperPortalStatus.cs new file mode 100644 index 000000000000..3621eff3c8ae --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/DeveloperPortalStatus.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Status of developer portal in this API Management service. + public partial struct DeveloperPortalStatus : + System.IEquatable + { + /// Developer Portal is disabled for the service. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus Disabled = @"Disabled"; + + /// Developer Portal is enabled for the service. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DeveloperPortalStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DeveloperPortalStatus(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DeveloperPortalStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DeveloperPortalStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DeveloperPortalStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DeveloperPortalStatus && Equals((DeveloperPortalStatus)obj); + } + + /// Returns hashCode for enum DeveloperPortalStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DeveloperPortalStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DeveloperPortalStatus + /// the value to convert to an instance of . + + public static implicit operator DeveloperPortalStatus(string value) + { + return new DeveloperPortalStatus(value); + } + + /// Implicit operator to convert DeveloperPortalStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus e) + { + return e._value; + } + + /// Overriding != operator for enum DeveloperPortalStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DeveloperPortalStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.DeveloperPortalStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ExportFormat.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ExportFormat.cs new file mode 100644 index 000000000000..02f290dafd65 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ExportFormat.cs @@ -0,0 +1,116 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct ExportFormat : + System.IEquatable + { + /// + /// Export the Api Definition in OpenAPI 3.0 Specification as JSON document to Storage Blob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat OpenapiJsonLink = @"openapi+json-link"; + + /// + /// Export the Api Definition in OpenAPI 3.0 Specification as YAML document to Storage Blob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat OpenapiLink = @"openapi-link"; + + /// + /// Export the Api Definition in OpenAPI 2.0 Specification as JSON document to the Storage Blob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat SwaggerLink = @"swagger-link"; + + /// Export the Api Definition in WADL Schema to Storage Blob. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat WadlLink = @"wadl-link"; + + /// + /// Export the Api Definition in WSDL Schema to Storage Blob. This is only supported for APIs of Type `soap` + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat WsdlLink = @"wsdl-link"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ExportFormat + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ExportFormat(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ExportFormat + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ExportFormat (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ExportFormat && Equals((ExportFormat)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ExportFormat(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum ExportFormat + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ExportFormat + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ExportFormat + /// the value to convert to an instance of . + + public static implicit operator ExportFormat(string value) + { + return new ExportFormat(value); + } + + /// Implicit operator to convert ExportFormat to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat e) + { + return e._value; + } + + /// Overriding != operator for enum ExportFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ExportFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportFormat e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ExportResultFormat.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ExportResultFormat.cs new file mode 100644 index 000000000000..dda7ab6b1157 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ExportResultFormat.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes. + /// + public partial struct ExportResultFormat : + System.IEquatable + { + /// Export the API Definition in OpenAPI Specification 3.0 to Storage Blob. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat OpenapiLink = @"openapi-link"; + + /// + /// The API Definition is exported in OpenAPI Specification 2.0 format to the Storage Blob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat SwaggerLinkJson = @"swagger-link-json"; + + /// Export the API Definition in WADL Schema to Storage Blob. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat WadlLinkJson = @"wadl-link-json"; + + /// + /// The API Definition is exported in WSDL Schema to Storage Blob. This is only supported for APIs of Type `soap` + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat WsdlLinkXml = @"wsdl-link+xml"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ExportResultFormat + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ExportResultFormat(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ExportResultFormat + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ExportResultFormat (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ExportResultFormat && Equals((ExportResultFormat)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ExportResultFormat(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum ExportResultFormat + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ExportResultFormat + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ExportResultFormat + /// the value to convert to an instance of . + + public static implicit operator ExportResultFormat(string value) + { + return new ExportResultFormat(value); + } + + /// Implicit operator to convert ExportResultFormat to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat e) + { + return e._value; + } + + /// Overriding != operator for enum ExportResultFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ExportResultFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ExportResultFormat e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/GatewayListDebugCredentialsContractPurpose.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/GatewayListDebugCredentialsContractPurpose.cs new file mode 100644 index 000000000000..47af897278f2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/GatewayListDebugCredentialsContractPurpose.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Purpose of debug credential. + public partial struct GatewayListDebugCredentialsContractPurpose : + System.IEquatable + { + /// The tracing purpose. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose Tracing = @"tracing"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to GatewayListDebugCredentialsContractPurpose + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new GatewayListDebugCredentialsContractPurpose(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type GatewayListDebugCredentialsContractPurpose + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type GatewayListDebugCredentialsContractPurpose (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is GatewayListDebugCredentialsContractPurpose && Equals((GatewayListDebugCredentialsContractPurpose)obj); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private GatewayListDebugCredentialsContractPurpose(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum GatewayListDebugCredentialsContractPurpose + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for GatewayListDebugCredentialsContractPurpose + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// + /// Implicit operator to convert string to GatewayListDebugCredentialsContractPurpose + /// + /// the value to convert to an instance of . + + public static implicit operator GatewayListDebugCredentialsContractPurpose(string value) + { + return new GatewayListDebugCredentialsContractPurpose(value); + } + + /// + /// Implicit operator to convert GatewayListDebugCredentialsContractPurpose to string + /// + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose e) + { + return e._value; + } + + /// Overriding != operator for enum GatewayListDebugCredentialsContractPurpose + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum GatewayListDebugCredentialsContractPurpose + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GatewayListDebugCredentialsContractPurpose e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/GrantType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/GrantType.cs new file mode 100644 index 000000000000..31be9da2c564 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/GrantType.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct GrantType : + System.IEquatable + { + /// + /// Authorization Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.1. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType AuthorizationCode = @"authorizationCode"; + + /// + /// Client Credentials Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.4. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType ClientCredentials = @"clientCredentials"; + + /// + /// Implicit Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.2. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType Implicit = @"implicit"; + + /// + /// Resource Owner Password Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.3. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType ResourceOwnerPassword = @"resourceOwnerPassword"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to GrantType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new GrantType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type GrantType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type GrantType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is GrantType && Equals((GrantType)obj); + } + + /// Returns hashCode for enum GrantType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private GrantType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for GrantType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to GrantType + /// the value to convert to an instance of . + + public static implicit operator GrantType(string value) + { + return new GrantType(value); + } + + /// Implicit operator to convert GrantType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType e) + { + return e._value; + } + + /// Overriding != operator for enum GrantType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum GrantType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GrantType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/GroupType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/GroupType.cs new file mode 100644 index 000000000000..637b42fdf3ad --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/GroupType.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Group type. + public partial struct GroupType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType Custom = @"custom"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType External = @"external"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType System = @"system"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to GroupType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new GroupType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type GroupType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type GroupType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is GroupType && Equals((GroupType)obj); + } + + /// Returns hashCode for enum GroupType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private GroupType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for GroupType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to GroupType + /// the value to convert to an instance of . + + public static implicit operator GroupType(string value) + { + return new GroupType(value); + } + + /// Implicit operator to convert GroupType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType e) + { + return e._value; + } + + /// Overriding != operator for enum GroupType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum GroupType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.GroupType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/HostnameType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/HostnameType.cs new file mode 100644 index 000000000000..6a41a0a87018 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/HostnameType.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Hostname type. + public partial struct HostnameType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType ConfigurationApi = @"ConfigurationApi"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType DeveloperPortal = @"DeveloperPortal"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType Management = @"Management"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType Portal = @"Portal"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType Proxy = @"Proxy"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType Scm = @"Scm"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to HostnameType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new HostnameType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type HostnameType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type HostnameType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is HostnameType && Equals((HostnameType)obj); + } + + /// Returns hashCode for enum HostnameType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private HostnameType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for HostnameType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to HostnameType + /// the value to convert to an instance of . + + public static implicit operator HostnameType(string value) + { + return new HostnameType(value); + } + + /// Implicit operator to convert HostnameType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType e) + { + return e._value; + } + + /// Overriding != operator for enum HostnameType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum HostnameType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HostnameType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/HttpCorrelationProtocol.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/HttpCorrelationProtocol.cs new file mode 100644 index 000000000000..59a34b2dc71b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/HttpCorrelationProtocol.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Sets correlation protocol to use for Application Insights diagnostics. + public partial struct HttpCorrelationProtocol : + System.IEquatable + { + /// + /// Inject Request-Id and Request-Context headers with request correlation data. See https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/HttpCorrelationProtocol.md. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol Legacy = @"Legacy"; + + /// Do not read and inject correlation headers. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol None = @"None"; + + /// Inject Trace Context headers. See https://w3c.github.io/trace-context. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol W3C = @"W3C"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to HttpCorrelationProtocol + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new HttpCorrelationProtocol(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type HttpCorrelationProtocol + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type HttpCorrelationProtocol (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is HttpCorrelationProtocol && Equals((HttpCorrelationProtocol)obj); + } + + /// Returns hashCode for enum HttpCorrelationProtocol + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private HttpCorrelationProtocol(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for HttpCorrelationProtocol + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to HttpCorrelationProtocol + /// the value to convert to an instance of . + + public static implicit operator HttpCorrelationProtocol(string value) + { + return new HttpCorrelationProtocol(value); + } + + /// Implicit operator to convert HttpCorrelationProtocol to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol e) + { + return e._value; + } + + /// Overriding != operator for enum HttpCorrelationProtocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum HttpCorrelationProtocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.HttpCorrelationProtocol e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/IdentityProviderType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/IdentityProviderType.cs new file mode 100644 index 000000000000..b468cf210bd8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/IdentityProviderType.cs @@ -0,0 +1,111 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct IdentityProviderType : + System.IEquatable + { + /// Azure Active Directory as Identity provider. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType Aad = @"aad"; + + /// Azure Active Directory B2C as Identity provider. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType AadB2C = @"aadB2C"; + + /// Facebook as Identity provider. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType Facebook = @"facebook"; + + /// Google as Identity provider. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType Google = @"google"; + + /// Microsoft Live as Identity provider. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType Microsoft = @"microsoft"; + + /// Twitter as Identity provider. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType Twitter = @"twitter"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IdentityProviderType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IdentityProviderType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IdentityProviderType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IdentityProviderType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is IdentityProviderType && Equals((IdentityProviderType)obj); + } + + /// Returns hashCode for enum IdentityProviderType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private IdentityProviderType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IdentityProviderType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IdentityProviderType + /// the value to convert to an instance of . + + public static implicit operator IdentityProviderType(string value) + { + return new IdentityProviderType(value); + } + + /// Implicit operator to convert IdentityProviderType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType e) + { + return e._value; + } + + /// Overriding != operator for enum IdentityProviderType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IdentityProviderType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IdentityProviderType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/IssueType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/IssueType.cs new file mode 100644 index 000000000000..752bddea869e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/IssueType.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The type of issue. + public partial struct IssueType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType AgentStopped = @"AgentStopped"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType DnsResolution = @"DnsResolution"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType GuestFirewall = @"GuestFirewall"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType NetworkSecurityRule = @"NetworkSecurityRule"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType Platform = @"Platform"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType PortThrottled = @"PortThrottled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType SocketBind = @"SocketBind"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType Unknown = @"Unknown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType UserDefinedRoute = @"UserDefinedRoute"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IssueType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IssueType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IssueType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IssueType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is IssueType && Equals((IssueType)obj); + } + + /// Returns hashCode for enum IssueType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private IssueType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IssueType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IssueType + /// the value to convert to an instance of . + + public static implicit operator IssueType(string value) + { + return new IssueType(value); + } + + /// Implicit operator to convert IssueType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType e) + { + return e._value; + } + + /// Overriding != operator for enum IssueType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IssueType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.IssueType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/KeyType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/KeyType.cs new file mode 100644 index 000000000000..8280474e1435 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/KeyType.cs @@ -0,0 +1,98 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The Key to be used to generate token for user. + public partial struct KeyType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType Primary = @"primary"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType Secondary = @"secondary"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KeyType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KeyType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KeyType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KeyType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is KeyType && Equals((KeyType)obj); + } + + /// Returns hashCode for enum KeyType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private KeyType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KeyType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KeyType + /// the value to convert to an instance of . + + public static implicit operator KeyType(string value) + { + return new KeyType(value); + } + + /// Implicit operator to convert KeyType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType e) + { + return e._value; + } + + /// Overriding != operator for enum KeyType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KeyType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/KeyVaultRefreshState.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/KeyVaultRefreshState.cs new file mode 100644 index 000000000000..97ebce1c29ae --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/KeyVaultRefreshState.cs @@ -0,0 +1,99 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct KeyVaultRefreshState : + System.IEquatable + { + /// Entities for which KeyVault refresh succeeded + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState False = @"false"; + + /// Entities for which KeyVault refresh failed. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState True = @"true"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KeyVaultRefreshState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KeyVaultRefreshState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KeyVaultRefreshState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KeyVaultRefreshState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is KeyVaultRefreshState && Equals((KeyVaultRefreshState)obj); + } + + /// Returns hashCode for enum KeyVaultRefreshState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private KeyVaultRefreshState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KeyVaultRefreshState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KeyVaultRefreshState + /// the value to convert to an instance of . + + public static implicit operator KeyVaultRefreshState(string value) + { + return new KeyVaultRefreshState(value); + } + + /// Implicit operator to convert KeyVaultRefreshState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState e) + { + return e._value; + } + + /// Overriding != operator for enum KeyVaultRefreshState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KeyVaultRefreshState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.KeyVaultRefreshState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/LegacyApiState.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/LegacyApiState.cs new file mode 100644 index 000000000000..f42135ec8a31 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/LegacyApiState.cs @@ -0,0 +1,108 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service. Value is + /// optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be available for self-hosted + /// gateways. Default value is 'Enabled' + /// + public partial struct LegacyApiState : + System.IEquatable + { + /// + /// Legacy Configuration API (v1) is disabled for the service and self-hosted gateways can not connect to it. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState Disabled = @"Disabled"; + + /// + /// Legacy Configuration API (v1) is enabled for the service and self-hosted gateways can connect to it. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LegacyApiState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LegacyApiState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LegacyApiState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LegacyApiState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LegacyApiState && Equals((LegacyApiState)obj); + } + + /// Returns hashCode for enum LegacyApiState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private LegacyApiState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LegacyApiState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LegacyApiState + /// the value to convert to an instance of . + + public static implicit operator LegacyApiState(string value) + { + return new LegacyApiState(value); + } + + /// Implicit operator to convert LegacyApiState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState e) + { + return e._value; + } + + /// Overriding != operator for enum LegacyApiState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LegacyApiState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyApiState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/LegacyPortalStatus.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/LegacyPortalStatus.cs new file mode 100644 index 000000000000..a73680a7d18c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/LegacyPortalStatus.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Status of legacy portal in the API Management service. + public partial struct LegacyPortalStatus : + System.IEquatable + { + /// Legacy Portal is disabled for the service. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus Disabled = @"Disabled"; + + /// Legacy Portal is enabled for the service. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LegacyPortalStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LegacyPortalStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LegacyPortalStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LegacyPortalStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LegacyPortalStatus && Equals((LegacyPortalStatus)obj); + } + + /// Returns hashCode for enum LegacyPortalStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private LegacyPortalStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LegacyPortalStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LegacyPortalStatus + /// the value to convert to an instance of . + + public static implicit operator LegacyPortalStatus(string value) + { + return new LegacyPortalStatus(value); + } + + /// Implicit operator to convert LegacyPortalStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus e) + { + return e._value; + } + + /// Overriding != operator for enum LegacyPortalStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LegacyPortalStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LegacyPortalStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/LoggerType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/LoggerType.cs new file mode 100644 index 000000000000..dc8304d0f5eb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/LoggerType.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Logger type. + public partial struct LoggerType : + System.IEquatable + { + /// Azure Application Insights as log destination. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType ApplicationInsights = @"applicationInsights"; + + /// Azure Event Hub as log destination. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType AzureEventHub = @"azureEventHub"; + + /// Azure Monitor + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType AzureMonitor = @"azureMonitor"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LoggerType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LoggerType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LoggerType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LoggerType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LoggerType && Equals((LoggerType)obj); + } + + /// Returns hashCode for enum LoggerType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private LoggerType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LoggerType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LoggerType + /// the value to convert to an instance of . + + public static implicit operator LoggerType(string value) + { + return new LoggerType(value); + } + + /// Implicit operator to convert LoggerType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType e) + { + return e._value; + } + + /// Overriding != operator for enum LoggerType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LoggerType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.LoggerType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/Method.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Method.cs new file mode 100644 index 000000000000..51d95c8172ba --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Method.cs @@ -0,0 +1,98 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The HTTP method to be used. + public partial struct Method : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method Get = @"GET"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method Post = @"POST"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Method + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Method(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Method + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Method (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Method && Equals((Method)obj); + } + + /// Returns hashCode for enum Method + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Method(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Method + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Method + /// the value to convert to an instance of . + + public static implicit operator Method(string value) + { + return new Method(value); + } + + /// Implicit operator to convert Method to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method e) + { + return e._value; + } + + /// Overriding != operator for enum Method + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Method + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Method e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/MigrateToStv2Mode.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/MigrateToStv2Mode.cs new file mode 100644 index 000000000000..fa9a00ac511d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/MigrateToStv2Mode.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Mode of Migration to stv2. Default is PreserveIp. + public partial struct MigrateToStv2Mode : + System.IEquatable + { + /// + /// Migrate API Management service to stv2 from stv1. This will have no downtime as the service configuration will be migrated + /// to new infrastructure, but the IP address will changed. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode NewIP = @"NewIP"; + + /// + /// Migrate API Management service to stv2 from stv1, by reserving the IP Address of the service. This will have a downtime + /// of upto 15 minutes, while the IP address is getting migrate to new infrastructure. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode PreserveIP = @"PreserveIp"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MigrateToStv2Mode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MigrateToStv2Mode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MigrateToStv2Mode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MigrateToStv2Mode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MigrateToStv2Mode && Equals((MigrateToStv2Mode)obj); + } + + /// Returns hashCode for enum MigrateToStv2Mode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private MigrateToStv2Mode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MigrateToStv2Mode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MigrateToStv2Mode + /// the value to convert to an instance of . + + public static implicit operator MigrateToStv2Mode(string value) + { + return new MigrateToStv2Mode(value); + } + + /// Implicit operator to convert MigrateToStv2Mode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode e) + { + return e._value; + } + + /// Overriding != operator for enum MigrateToStv2Mode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MigrateToStv2Mode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.MigrateToStv2Mode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/NameAvailabilityReason.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/NameAvailabilityReason.cs new file mode 100644 index 000000000000..5fc7540d0e45 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/NameAvailabilityReason.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported + /// characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable. + /// + public partial struct NameAvailabilityReason : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason AlreadyExists = @"AlreadyExists"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason Valid = @"Valid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NameAvailabilityReason + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NameAvailabilityReason(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NameAvailabilityReason + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NameAvailabilityReason (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is NameAvailabilityReason && Equals((NameAvailabilityReason)obj); + } + + /// Returns hashCode for enum NameAvailabilityReason + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private NameAvailabilityReason(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NameAvailabilityReason + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NameAvailabilityReason + /// the value to convert to an instance of . + + public static implicit operator NameAvailabilityReason(string value) + { + return new NameAvailabilityReason(value); + } + + /// Implicit operator to convert NameAvailabilityReason to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason e) + { + return e._value; + } + + /// Overriding != operator for enum NameAvailabilityReason + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NameAvailabilityReason + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NameAvailabilityReason e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/NatGatewayState.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/NatGatewayState.cs new file mode 100644 index 000000000000..a1ad10a9e582 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/NatGatewayState.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Property can be used to enable NAT Gateway for this API Management service. + public partial struct NatGatewayState : + System.IEquatable + { + /// Nat Gateway is disabled for the service. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState Disabled = @"Disabled"; + + /// Nat Gateway is enabled for the service. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NatGatewayState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NatGatewayState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NatGatewayState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NatGatewayState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is NatGatewayState && Equals((NatGatewayState)obj); + } + + /// Returns hashCode for enum NatGatewayState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private NatGatewayState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NatGatewayState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NatGatewayState + /// the value to convert to an instance of . + + public static implicit operator NatGatewayState(string value) + { + return new NatGatewayState(value); + } + + /// Implicit operator to convert NatGatewayState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState e) + { + return e._value; + } + + /// Overriding != operator for enum NatGatewayState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NatGatewayState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NatGatewayState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/NotificationName.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/NotificationName.cs new file mode 100644 index 000000000000..e9a030653565 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/NotificationName.cs @@ -0,0 +1,132 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct NotificationName : + System.IEquatable + { + /// + /// The following email recipients and users will receive email notifications when developer closes his account. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName AccountClosedPublisher = @"AccountClosedPublisher"; + + /// + /// The following recipients will receive blind carbon copies of all emails sent to developers. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName Bcc = @"BCC"; + + /// + /// The following email recipients and users will receive email notifications when new applications are submitted to the application + /// gallery. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName NewApplicationNotificationMessage = @"NewApplicationNotificationMessage"; + + /// + /// The following email recipients and users will receive email notifications when a new issue or comment is submitted on + /// the developer portal. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName NewIssuePublisherNotificationMessage = @"NewIssuePublisherNotificationMessage"; + + /// + /// The following email recipients and users will receive email notifications about new API product subscriptions. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName PurchasePublisherNotificationMessage = @"PurchasePublisherNotificationMessage"; + + /// + /// The following email recipients and users will receive email notifications when subscription usage gets close to usage + /// quota. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName QuotaLimitApproachingPublisherNotificationMessage = @"QuotaLimitApproachingPublisherNotificationMessage"; + + /// + /// The following email recipients and users will receive email notifications about subscription requests for API products + /// requiring approval. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName RequestPublisherNotificationMessage = @"RequestPublisherNotificationMessage"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NotificationName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NotificationName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NotificationName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NotificationName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is NotificationName && Equals((NotificationName)obj); + } + + /// Returns hashCode for enum NotificationName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private NotificationName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NotificationName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NotificationName + /// the value to convert to an instance of . + + public static implicit operator NotificationName(string value) + { + return new NotificationName(value); + } + + /// Implicit operator to convert NotificationName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName e) + { + return e._value; + } + + /// Overriding != operator for enum NotificationName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NotificationName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.NotificationName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/OAuth2GrantType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/OAuth2GrantType.cs new file mode 100644 index 000000000000..453c4491f2ed --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/OAuth2GrantType.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// OAuth2 grant type options + public partial struct OAuth2GrantType : + System.IEquatable + { + /// Authorization Code grant + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType AuthorizationCode = @"AuthorizationCode"; + + /// Client Credential grant + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType ClientCredentials = @"ClientCredentials"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to OAuth2GrantType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new OAuth2GrantType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type OAuth2GrantType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type OAuth2GrantType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is OAuth2GrantType && Equals((OAuth2GrantType)obj); + } + + /// Returns hashCode for enum OAuth2GrantType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private OAuth2GrantType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for OAuth2GrantType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to OAuth2GrantType + /// the value to convert to an instance of . + + public static implicit operator OAuth2GrantType(string value) + { + return new OAuth2GrantType(value); + } + + /// Implicit operator to convert OAuth2GrantType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType e) + { + return e._value; + } + + /// Overriding != operator for enum OAuth2GrantType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum OAuth2GrantType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OAuth2GrantType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/OperationNameFormat.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/OperationNameFormat.cs new file mode 100644 index 000000000000..5330be28b309 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/OperationNameFormat.cs @@ -0,0 +1,102 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// The format of the Operation Name for Application Insights telemetries. Default is Name. + /// + public partial struct OperationNameFormat : + System.IEquatable + { + /// API_NAME;rev=API_REVISION - OPERATION_NAME + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat Name = @"Name"; + + /// HTTP_VERB URL + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat Url = @"Url"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to OperationNameFormat + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new OperationNameFormat(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type OperationNameFormat + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type OperationNameFormat (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is OperationNameFormat && Equals((OperationNameFormat)obj); + } + + /// Returns hashCode for enum OperationNameFormat + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private OperationNameFormat(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for OperationNameFormat + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to OperationNameFormat + /// the value to convert to an instance of . + + public static implicit operator OperationNameFormat(string value) + { + return new OperationNameFormat(value); + } + + /// Implicit operator to convert OperationNameFormat to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat e) + { + return e._value; + } + + /// Overriding != operator for enum OperationNameFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum OperationNameFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.OperationNameFormat e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/Origin.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Origin.cs new file mode 100644 index 000000000000..eae2949fce1c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Origin.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The origin of the issue. + public partial struct Origin : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin Inbound = @"Inbound"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin Local = @"Local"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin Outbound = @"Outbound"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Origin + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Origin(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Origin + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Origin (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Origin && Equals((Origin)obj); + } + + /// Returns hashCode for enum Origin + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Origin(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Origin + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Origin + /// the value to convert to an instance of . + + public static implicit operator Origin(string value) + { + return new Origin(value); + } + + /// Implicit operator to convert Origin to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin e) + { + return e._value; + } + + /// Overriding != operator for enum Origin + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Origin + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Origin e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PlatformVersion.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PlatformVersion.cs new file mode 100644 index 000000000000..e4f6ca5dc70e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PlatformVersion.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Compute Platform Version running the service. + public partial struct PlatformVersion : + System.IEquatable + { + /// Platform running the service on Multi Tenant V1 platform. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion Mtv1 = @"mtv1"; + + /// Platform running the service on Single Tenant V1 platform. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion Stv1 = @"stv1"; + + /// Platform running the service on Single Tenant V2 platform. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion Stv2 = @"stv2"; + + /// Platform running the service on Single Tenant V2 platform on newer Hardware. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion Stv21 = @"stv2.1"; + + /// Platform version cannot be determined, as compute platform is not deployed. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion Undetermined = @"undetermined"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PlatformVersion + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PlatformVersion(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PlatformVersion + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PlatformVersion (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PlatformVersion && Equals((PlatformVersion)obj); + } + + /// Returns hashCode for enum PlatformVersion + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PlatformVersion(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PlatformVersion + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PlatformVersion + /// the value to convert to an instance of . + + public static implicit operator PlatformVersion(string value) + { + return new PlatformVersion(value); + } + + /// Implicit operator to convert PlatformVersion to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion e) + { + return e._value; + } + + /// Overriding != operator for enum PlatformVersion + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PlatformVersion + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PlatformVersion e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyComplianceState.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyComplianceState.cs new file mode 100644 index 000000000000..7cede5f01cfc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyComplianceState.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Policy Restriction Compliance State + public partial struct PolicyComplianceState : + System.IEquatable + { + /// The scope in restriction is in compliance. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState Compliant = @"Compliant"; + + /// The scope in restriction is out of compliance. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState NonCompliant = @"NonCompliant"; + + /// The policy restriction compliance state has not yet been determined. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState Pending = @"Pending"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PolicyComplianceState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PolicyComplianceState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PolicyComplianceState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PolicyComplianceState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PolicyComplianceState && Equals((PolicyComplianceState)obj); + } + + /// Returns hashCode for enum PolicyComplianceState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PolicyComplianceState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PolicyComplianceState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PolicyComplianceState + /// the value to convert to an instance of . + + public static implicit operator PolicyComplianceState(string value) + { + return new PolicyComplianceState(value); + } + + /// Implicit operator to convert PolicyComplianceState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState e) + { + return e._value; + } + + /// Overriding != operator for enum PolicyComplianceState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PolicyComplianceState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyComplianceState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyContentFormat.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyContentFormat.cs new file mode 100644 index 000000000000..78701ff82a36 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyContentFormat.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Format of the policyContent. + public partial struct PolicyContentFormat : + System.IEquatable + { + /// The contents are inline and Content type is a non XML encoded policy document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat Rawxml = @"rawxml"; + + /// + /// The policy document is not XML encoded and is hosted on a HTTP endpoint accessible from the API Management service. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat RawxmlLink = @"rawxml-link"; + + /// The contents are inline and Content type is an XML document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat Xml = @"xml"; + + /// + /// The policy XML document is hosted on a HTTP endpoint accessible from the API Management service. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat XmlLink = @"xml-link"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PolicyContentFormat + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PolicyContentFormat(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PolicyContentFormat + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PolicyContentFormat (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PolicyContentFormat && Equals((PolicyContentFormat)obj); + } + + /// Returns hashCode for enum PolicyContentFormat + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PolicyContentFormat(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PolicyContentFormat + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PolicyContentFormat + /// the value to convert to an instance of . + + public static implicit operator PolicyContentFormat(string value) + { + return new PolicyContentFormat(value); + } + + /// Implicit operator to convert PolicyContentFormat to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat e) + { + return e._value; + } + + /// Overriding != operator for enum PolicyContentFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PolicyContentFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyContentFormat e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyExportFormat.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyExportFormat.cs new file mode 100644 index 000000000000..f78de578e286 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyExportFormat.cs @@ -0,0 +1,99 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct PolicyExportFormat : + System.IEquatable + { + /// The contents are inline and Content type is a non XML encoded policy document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat Rawxml = @"rawxml"; + + /// The contents are inline and Content type is an XML document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat Xml = @"xml"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PolicyExportFormat + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PolicyExportFormat(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PolicyExportFormat + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PolicyExportFormat (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PolicyExportFormat && Equals((PolicyExportFormat)obj); + } + + /// Returns hashCode for enum PolicyExportFormat + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PolicyExportFormat(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PolicyExportFormat + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PolicyExportFormat + /// the value to convert to an instance of . + + public static implicit operator PolicyExportFormat(string value) + { + return new PolicyExportFormat(value); + } + + /// Implicit operator to convert PolicyExportFormat to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat e) + { + return e._value; + } + + /// Overriding != operator for enum PolicyExportFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PolicyExportFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyExportFormat e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyFragmentContentFormat.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyFragmentContentFormat.cs new file mode 100644 index 000000000000..9430e16b0fe6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyFragmentContentFormat.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct PolicyFragmentContentFormat : + System.IEquatable + { + /// The contents are inline and Content type is a non XML encoded policy document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat Rawxml = @"rawxml"; + + /// The contents are inline and Content type is an XML document. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat Xml = @"xml"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PolicyFragmentContentFormat + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PolicyFragmentContentFormat(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PolicyFragmentContentFormat + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PolicyFragmentContentFormat (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PolicyFragmentContentFormat && Equals((PolicyFragmentContentFormat)obj); + } + + /// Returns hashCode for enum PolicyFragmentContentFormat + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private PolicyFragmentContentFormat(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PolicyFragmentContentFormat + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PolicyFragmentContentFormat + /// the value to convert to an instance of . + + public static implicit operator PolicyFragmentContentFormat(string value) + { + return new PolicyFragmentContentFormat(value); + } + + /// Implicit operator to convert PolicyFragmentContentFormat to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat e) + { + return e._value; + } + + /// Overriding != operator for enum PolicyFragmentContentFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PolicyFragmentContentFormat + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyFragmentContentFormat e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyIdName.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyIdName.cs new file mode 100644 index 000000000000..ffd642cf81a4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyIdName.cs @@ -0,0 +1,95 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct PolicyIdName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName Policy = @"policy"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PolicyIdName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PolicyIdName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PolicyIdName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PolicyIdName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PolicyIdName && Equals((PolicyIdName)obj); + } + + /// Returns hashCode for enum PolicyIdName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PolicyIdName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PolicyIdName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PolicyIdName + /// the value to convert to an instance of . + + public static implicit operator PolicyIdName(string value) + { + return new PolicyIdName(value); + } + + /// Implicit operator to convert PolicyIdName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName e) + { + return e._value; + } + + /// Overriding != operator for enum PolicyIdName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PolicyIdName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyIdName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyRestrictionRequireBase.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyRestrictionRequireBase.cs new file mode 100644 index 000000000000..fb1f6b455eaa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyRestrictionRequireBase.cs @@ -0,0 +1,104 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Indicates if base policy should be enforced for the policy document. + public partial struct PolicyRestrictionRequireBase : + System.IEquatable + { + /// The policy does not require to have base policy + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase False = @"false"; + + /// The policy is required to have base policy + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase True = @"true"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PolicyRestrictionRequireBase + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PolicyRestrictionRequireBase(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PolicyRestrictionRequireBase + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PolicyRestrictionRequireBase (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PolicyRestrictionRequireBase && Equals((PolicyRestrictionRequireBase)obj); + } + + /// Returns hashCode for enum PolicyRestrictionRequireBase + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private PolicyRestrictionRequireBase(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PolicyRestrictionRequireBase + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PolicyRestrictionRequireBase + /// the value to convert to an instance of . + + public static implicit operator PolicyRestrictionRequireBase(string value) + { + return new PolicyRestrictionRequireBase(value); + } + + /// Implicit operator to convert PolicyRestrictionRequireBase to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase e) + { + return e._value; + } + + /// Overriding != operator for enum PolicyRestrictionRequireBase + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PolicyRestrictionRequireBase + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyRestrictionRequireBase e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyScopeContract.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyScopeContract.cs new file mode 100644 index 000000000000..f8c2bdcd26e9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PolicyScopeContract.cs @@ -0,0 +1,103 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct PolicyScopeContract : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract All = @"All"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract Api = @"Api"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract Operation = @"Operation"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract Product = @"Product"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract Tenant = @"Tenant"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PolicyScopeContract + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PolicyScopeContract(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PolicyScopeContract + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PolicyScopeContract (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PolicyScopeContract && Equals((PolicyScopeContract)obj); + } + + /// Returns hashCode for enum PolicyScopeContract + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PolicyScopeContract(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PolicyScopeContract + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PolicyScopeContract + /// the value to convert to an instance of . + + public static implicit operator PolicyScopeContract(string value) + { + return new PolicyScopeContract(value); + } + + /// Implicit operator to convert PolicyScopeContract to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract e) + { + return e._value; + } + + /// Overriding != operator for enum PolicyScopeContract + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PolicyScopeContract + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PolicyScopeContract e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PortalRevisionStatus.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PortalRevisionStatus.cs new file mode 100644 index 000000000000..7be0b51654ad --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PortalRevisionStatus.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Status of the portal's revision. + public partial struct PortalRevisionStatus : + System.IEquatable + { + /// Portal's revision publishing completed. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus Completed = @"completed"; + + /// Portal's revision publishing failed. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus Failed = @"failed"; + + /// Portal's revision has been queued. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus Pending = @"pending"; + + /// Portal's revision is being published. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus Publishing = @"publishing"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PortalRevisionStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PortalRevisionStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PortalRevisionStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PortalRevisionStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PortalRevisionStatus && Equals((PortalRevisionStatus)obj); + } + + /// Returns hashCode for enum PortalRevisionStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PortalRevisionStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PortalRevisionStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PortalRevisionStatus + /// the value to convert to an instance of . + + public static implicit operator PortalRevisionStatus(string value) + { + return new PortalRevisionStatus(value); + } + + /// Implicit operator to convert PortalRevisionStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus e) + { + return e._value; + } + + /// Overriding != operator for enum PortalRevisionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PortalRevisionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalRevisionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PortalSettingsCspMode.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PortalSettingsCspMode.cs new file mode 100644 index 000000000000..b8556ad7b6a9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PortalSettingsCspMode.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The mode of the developer portal Content Security Policy (CSP). + public partial struct PortalSettingsCspMode : + System.IEquatable + { + /// The browser will not apply the origin restrictions. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode Disabled = @"disabled"; + + /// The browser will block requests not matching allowed origins. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode Enabled = @"enabled"; + + /// + /// The browser will report requests not matching allowed origins without blocking them. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode ReportOnly = @"reportOnly"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PortalSettingsCspMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PortalSettingsCspMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PortalSettingsCspMode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PortalSettingsCspMode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PortalSettingsCspMode && Equals((PortalSettingsCspMode)obj); + } + + /// Returns hashCode for enum PortalSettingsCspMode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PortalSettingsCspMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PortalSettingsCspMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PortalSettingsCspMode + /// the value to convert to an instance of . + + public static implicit operator PortalSettingsCspMode(string value) + { + return new PortalSettingsCspMode(value); + } + + /// Implicit operator to convert PortalSettingsCspMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode e) + { + return e._value; + } + + /// Overriding != operator for enum PortalSettingsCspMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PortalSettingsCspMode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PortalSettingsCspMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PreferredIPVersion.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PreferredIPVersion.cs new file mode 100644 index 000000000000..ddc7fbf4da75 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PreferredIPVersion.cs @@ -0,0 +1,96 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The IP version to be used. Only IPv4 is supported for now. + public partial struct PreferredIPVersion : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion IPv4 = @"IPv4"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PreferredIPVersion + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PreferredIPVersion(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PreferredIPVersion + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PreferredIPVersion (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PreferredIPVersion && Equals((PreferredIPVersion)obj); + } + + /// Returns hashCode for enum PreferredIPVersion + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PreferredIPVersion(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PreferredIPVersion + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PreferredIPVersion + /// the value to convert to an instance of . + + public static implicit operator PreferredIPVersion(string value) + { + return new PreferredIPVersion(value); + } + + /// Implicit operator to convert PreferredIPVersion to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion e) + { + return e._value; + } + + /// Overriding != operator for enum PreferredIPVersion + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PreferredIPVersion + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PreferredIPVersion e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 000000000000..188109457e07 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The current provisioning state. + public partial struct PrivateEndpointConnectionProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState Succeeded = @"Succeeded"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PrivateEndpointConnectionProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PrivateEndpointConnectionProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PrivateEndpointConnectionProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PrivateEndpointConnectionProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PrivateEndpointConnectionProvisioningState && Equals((PrivateEndpointConnectionProvisioningState)obj); + } + + /// Returns hashCode for enum PrivateEndpointConnectionProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private PrivateEndpointConnectionProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PrivateEndpointConnectionProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// + /// Implicit operator to convert string to PrivateEndpointConnectionProvisioningState + /// + /// the value to convert to an instance of . + + public static implicit operator PrivateEndpointConnectionProvisioningState(string value) + { + return new PrivateEndpointConnectionProvisioningState(value); + } + + /// + /// Implicit operator to convert PrivateEndpointConnectionProvisioningState to string + /// + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum PrivateEndpointConnectionProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PrivateEndpointConnectionProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointConnectionProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 000000000000..507d1e12fa10 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,106 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The private endpoint connection status. + public partial struct PrivateEndpointServiceConnectionStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus Approved = @"Approved"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus Pending = @"Pending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus Rejected = @"Rejected"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PrivateEndpointServiceConnectionStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PrivateEndpointServiceConnectionStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PrivateEndpointServiceConnectionStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PrivateEndpointServiceConnectionStatus (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PrivateEndpointServiceConnectionStatus && Equals((PrivateEndpointServiceConnectionStatus)obj); + } + + /// Returns hashCode for enum PrivateEndpointServiceConnectionStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private PrivateEndpointServiceConnectionStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PrivateEndpointServiceConnectionStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PrivateEndpointServiceConnectionStatus + /// the value to convert to an instance of . + + public static implicit operator PrivateEndpointServiceConnectionStatus(string value) + { + return new PrivateEndpointServiceConnectionStatus(value); + } + + /// Implicit operator to convert PrivateEndpointServiceConnectionStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus e) + { + return e._value; + } + + /// Overriding != operator for enum PrivateEndpointServiceConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PrivateEndpointServiceConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PrivateEndpointServiceConnectionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ProductState.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ProductState.cs new file mode 100644 index 000000000000..dbfd8a71f3bb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ProductState.cs @@ -0,0 +1,101 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// whether product is published or not. Published products are discoverable by users of developer portal. Non published products + /// are visible only to administrators. Default state of Product is notPublished. + /// + public partial struct ProductState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState NotPublished = @"notPublished"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState Published = @"published"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProductState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProductState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProductState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProductState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProductState && Equals((ProductState)obj); + } + + /// Returns hashCode for enum ProductState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ProductState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProductState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProductState + /// the value to convert to an instance of . + + public static implicit operator ProductState(string value) + { + return new ProductState(value); + } + + /// Implicit operator to convert ProductState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState e) + { + return e._value; + } + + /// Overriding != operator for enum ProductState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProductState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProductState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/Protocol.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Protocol.cs new file mode 100644 index 000000000000..fbf150dff9d8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Protocol.cs @@ -0,0 +1,101 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct Protocol : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol Http = @"http"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol Https = @"https"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol Ws = @"ws"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol Wss = @"wss"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Protocol + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Protocol(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Protocol + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Protocol (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Protocol && Equals((Protocol)obj); + } + + /// Returns hashCode for enum Protocol + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Protocol(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Protocol + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Protocol + /// the value to convert to an instance of . + + public static implicit operator Protocol(string value) + { + return new Protocol(value); + } + + /// Implicit operator to convert Protocol to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol e) + { + return e._value; + } + + /// Overriding != operator for enum Protocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Protocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Protocol e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ProvisioningState.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ProvisioningState.cs new file mode 100644 index 000000000000..67cdf001651c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ProvisioningState.cs @@ -0,0 +1,96 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Provisioning state. + public partial struct ProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState Created = @"created"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProvisioningState && Equals((ProvisioningState)obj); + } + + /// Returns hashCode for enum ProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProvisioningState + /// the value to convert to an instance of . + + public static implicit operator ProvisioningState(string value) + { + return new ProvisioningState(value); + } + + /// Implicit operator to convert ProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum ProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/PublicNetworkAccess.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PublicNetworkAccess.cs new file mode 100644 index 000000000000..08cecd02ceab --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/PublicNetworkAccess.cs @@ -0,0 +1,101 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, + /// must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' + /// + public partial struct PublicNetworkAccess : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PublicNetworkAccess + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PublicNetworkAccess(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PublicNetworkAccess + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PublicNetworkAccess (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PublicNetworkAccess && Equals((PublicNetworkAccess)obj); + } + + /// Returns hashCode for enum PublicNetworkAccess + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PublicNetworkAccess(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PublicNetworkAccess + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PublicNetworkAccess + /// the value to convert to an instance of . + + public static implicit operator PublicNetworkAccess(string value) + { + return new PublicNetworkAccess(value); + } + + /// Implicit operator to convert PublicNetworkAccess to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess e) + { + return e._value; + } + + /// Overriding != operator for enum PublicNetworkAccess + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PublicNetworkAccess + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.PublicNetworkAccess e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/ResourceSkuCapacityScaleType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ResourceSkuCapacityScaleType.cs new file mode 100644 index 000000000000..4956237aeb22 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/ResourceSkuCapacityScaleType.cs @@ -0,0 +1,107 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The scale type applicable to the sku. + public partial struct ResourceSkuCapacityScaleType : + System.IEquatable + { + /// Supported scale type automatic. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType Automatic = @"automatic"; + + /// Supported scale type manual. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType Manual = @"manual"; + + /// Scaling not supported. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType None = @"none"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceSkuCapacityScaleType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceSkuCapacityScaleType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceSkuCapacityScaleType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ResourceSkuCapacityScaleType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ResourceSkuCapacityScaleType && Equals((ResourceSkuCapacityScaleType)obj); + } + + /// Returns hashCode for enum ResourceSkuCapacityScaleType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private ResourceSkuCapacityScaleType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceSkuCapacityScaleType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceSkuCapacityScaleType + /// the value to convert to an instance of . + + public static implicit operator ResourceSkuCapacityScaleType(string value) + { + return new ResourceSkuCapacityScaleType(value); + } + + /// Implicit operator to convert ResourceSkuCapacityScaleType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceSkuCapacityScaleType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceSkuCapacityScaleType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.ResourceSkuCapacityScaleType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/SamplingType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SamplingType.cs new file mode 100644 index 000000000000..ad42103a026a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SamplingType.cs @@ -0,0 +1,97 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Sampling type. + public partial struct SamplingType : + System.IEquatable + { + /// Fixed-rate sampling. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType Fixed = @"fixed"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SamplingType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SamplingType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SamplingType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SamplingType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SamplingType && Equals((SamplingType)obj); + } + + /// Returns hashCode for enum SamplingType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SamplingType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SamplingType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SamplingType + /// the value to convert to an instance of . + + public static implicit operator SamplingType(string value) + { + return new SamplingType(value); + } + + /// Implicit operator to convert SamplingType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType e) + { + return e._value; + } + + /// Overriding != operator for enum SamplingType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SamplingType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SamplingType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/SchemaType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SchemaType.cs new file mode 100644 index 000000000000..0ca5cb4fb89a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SchemaType.cs @@ -0,0 +1,100 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Schema Type. Immutable. + public partial struct SchemaType : + System.IEquatable + { + /// Json schema type. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType Json = @"json"; + + /// XML schema type. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType Xml = @"xml"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SchemaType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SchemaType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SchemaType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SchemaType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SchemaType && Equals((SchemaType)obj); + } + + /// Returns hashCode for enum SchemaType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SchemaType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SchemaType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SchemaType + /// the value to convert to an instance of . + + public static implicit operator SchemaType(string value) + { + return new SchemaType(value); + } + + /// Implicit operator to convert SchemaType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType e) + { + return e._value; + } + + /// Overriding != operator for enum SchemaType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SchemaType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SchemaType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/SettingsTypeName.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SettingsTypeName.cs new file mode 100644 index 000000000000..7e3bf544e883 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SettingsTypeName.cs @@ -0,0 +1,95 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct SettingsTypeName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName Public = @"public"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SettingsTypeName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SettingsTypeName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SettingsTypeName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SettingsTypeName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SettingsTypeName && Equals((SettingsTypeName)obj); + } + + /// Returns hashCode for enum SettingsTypeName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SettingsTypeName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SettingsTypeName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SettingsTypeName + /// the value to convert to an instance of . + + public static implicit operator SettingsTypeName(string value) + { + return new SettingsTypeName(value); + } + + /// Implicit operator to convert SettingsTypeName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName e) + { + return e._value; + } + + /// Overriding != operator for enum SettingsTypeName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SettingsTypeName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SettingsTypeName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/Severity.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Severity.cs new file mode 100644 index 000000000000..8dbc5d53da11 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Severity.cs @@ -0,0 +1,98 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The severity of the issue. + public partial struct Severity : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity Error = @"Error"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity Warning = @"Warning"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Severity + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Severity(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Severity + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Severity (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Severity && Equals((Severity)obj); + } + + /// Returns hashCode for enum Severity + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Severity(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Severity + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Severity + /// the value to convert to an instance of . + + public static implicit operator Severity(string value) + { + return new Severity(value); + } + + /// Implicit operator to convert Severity to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity e) + { + return e._value; + } + + /// Overriding != operator for enum Severity + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Severity + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Severity e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/SkuType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SkuType.cs new file mode 100644 index 000000000000..4e7373bbf9e3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SkuType.cs @@ -0,0 +1,118 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Name of the Sku. + public partial struct SkuType : + System.IEquatable + { + /// Basic SKU of Api Management. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType Basic = @"Basic"; + + /// BasicV2 SKU of Api Management. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType BasicV2 = @"BasicV2"; + + /// Consumption SKU of Api Management. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType Consumption = @"Consumption"; + + /// Developer SKU of Api Management. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType Developer = @"Developer"; + + /// Isolated SKU of Api Management. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType Isolated = @"Isolated"; + + /// Premium SKU of Api Management. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType Premium = @"Premium"; + + /// Standard SKU of Api Management. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType Standard = @"Standard"; + + /// StandardV2 SKU of Api Management. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType StandardV2 = @"StandardV2"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SkuType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SkuType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SkuType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SkuType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SkuType && Equals((SkuType)obj); + } + + /// Returns hashCode for enum SkuType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SkuType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SkuType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SkuType + /// the value to convert to an instance of . + + public static implicit operator SkuType(string value) + { + return new SkuType(value); + } + + /// Implicit operator to convert SkuType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType e) + { + return e._value; + } + + /// Overriding != operator for enum SkuType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SkuType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SkuType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/SoapApiType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SoapApiType.cs new file mode 100644 index 000000000000..bc32d0bcde86 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SoapApiType.cs @@ -0,0 +1,119 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Type of API to create. + /// * `http` creates a REST API + /// * `soap` creates a SOAP pass-through API + /// * `websocket` creates websocket API + /// * `graphql` creates GraphQL API. + /// New types can be added in the future. + /// + public partial struct SoapApiType : + System.IEquatable + { + /// Imports the API having a GraphQL front end. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType Graphql = @"graphql"; + + /// Imports the API having a gRPC front end. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType Grpc = @"grpc"; + + /// Imports a SOAP API having a RESTful front end. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType Http = @"http"; + + /// Imports the API having a OData front end. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType Odata = @"odata"; + + /// Imports the SOAP API having a SOAP front end. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType Soap = @"soap"; + + /// Imports the API having a Websocket front end. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType Websocket = @"websocket"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SoapApiType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SoapApiType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SoapApiType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SoapApiType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SoapApiType && Equals((SoapApiType)obj); + } + + /// Returns hashCode for enum SoapApiType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SoapApiType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SoapApiType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SoapApiType + /// the value to convert to an instance of . + + public static implicit operator SoapApiType(string value) + { + return new SoapApiType(value); + } + + /// Implicit operator to convert SoapApiType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType e) + { + return e._value; + } + + /// Overriding != operator for enum SoapApiType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SoapApiType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SoapApiType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/State.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/State.cs new file mode 100644 index 000000000000..6805475da03a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/State.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// Status of the issue. + public partial struct State : + System.IEquatable + { + /// The issue was closed. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State Closed = @"closed"; + + /// The issue is opened. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State Open = @"open"; + + /// The issue is proposed. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State Proposed = @"proposed"; + + /// The issue was removed. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State Removed = @"removed"; + + /// The issue is now resolved. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State Resolved = @"resolved"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to State + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new State(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type State + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type State (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is State && Equals((State)obj); + } + + /// Returns hashCode for enum State + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private State(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for State + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to State + /// the value to convert to an instance of . + + public static implicit operator State(string value) + { + return new State(value); + } + + /// Implicit operator to convert State to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State e) + { + return e._value; + } + + /// Overriding != operator for enum State + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum State + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.State e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/SubscriptionState.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SubscriptionState.cs new file mode 100644 index 000000000000..f9653b465ac6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/SubscriptionState.cs @@ -0,0 +1,112 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, + /// and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, + /// but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, + /// * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached + /// its expiration date and was deactivated. + /// + public partial struct SubscriptionState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState Active = @"active"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState Cancelled = @"cancelled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState Expired = @"expired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState Rejected = @"rejected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState Submitted = @"submitted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState Suspended = @"suspended"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SubscriptionState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SubscriptionState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SubscriptionState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SubscriptionState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SubscriptionState && Equals((SubscriptionState)obj); + } + + /// Returns hashCode for enum SubscriptionState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SubscriptionState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SubscriptionState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SubscriptionState + /// the value to convert to an instance of . + + public static implicit operator SubscriptionState(string value) + { + return new SubscriptionState(value); + } + + /// Implicit operator to convert SubscriptionState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState e) + { + return e._value; + } + + /// Overriding != operator for enum SubscriptionState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SubscriptionState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.SubscriptionState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/TemplateName.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/TemplateName.cs new file mode 100644 index 000000000000..db9aba892225 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/TemplateName.cs @@ -0,0 +1,121 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + public partial struct TemplateName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName AccountClosedDeveloper = @"accountClosedDeveloper"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName ApplicationApprovedNotificationMessage = @"applicationApprovedNotificationMessage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName ConfirmSignUpIdentityDefault = @"confirmSignUpIdentityDefault"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName EmailChangeIdentityDefault = @"emailChangeIdentityDefault"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName InviteUserNotificationMessage = @"inviteUserNotificationMessage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName NewCommentNotificationMessage = @"newCommentNotificationMessage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName NewDeveloperNotificationMessage = @"newDeveloperNotificationMessage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName NewIssueNotificationMessage = @"newIssueNotificationMessage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName PasswordResetByAdminNotificationMessage = @"passwordResetByAdminNotificationMessage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName PasswordResetIdentityDefault = @"passwordResetIdentityDefault"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName PurchaseDeveloperNotificationMessage = @"purchaseDeveloperNotificationMessage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName QuotaLimitApproachingDeveloperNotificationMessage = @"quotaLimitApproachingDeveloperNotificationMessage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName RejectDeveloperNotificationMessage = @"rejectDeveloperNotificationMessage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName RequestDeveloperNotificationMessage = @"requestDeveloperNotificationMessage"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TemplateName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TemplateName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TemplateName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TemplateName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is TemplateName && Equals((TemplateName)obj); + } + + /// Returns hashCode for enum TemplateName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private TemplateName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for TemplateName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to TemplateName + /// the value to convert to an instance of . + + public static implicit operator TemplateName(string value) + { + return new TemplateName(value); + } + + /// Implicit operator to convert TemplateName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName e) + { + return e._value; + } + + /// Overriding != operator for enum TemplateName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TemplateName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TemplateName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/TranslateRequiredQueryParametersConduct.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/TranslateRequiredQueryParametersConduct.cs new file mode 100644 index 000000000000..fd47195c2e6e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/TranslateRequiredQueryParametersConduct.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: + /// 'template', 'query' + /// + public partial struct TranslateRequiredQueryParametersConduct : + System.IEquatable + { + /// Leaves required query parameters as they are (no translation done). + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct Query = @"query"; + + /// Translates required query parameters to template ones. Is a default value + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct Template = @"template"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to TranslateRequiredQueryParametersConduct + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TranslateRequiredQueryParametersConduct(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TranslateRequiredQueryParametersConduct + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type TranslateRequiredQueryParametersConduct (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is TranslateRequiredQueryParametersConduct && Equals((TranslateRequiredQueryParametersConduct)obj); + } + + /// Returns hashCode for enum TranslateRequiredQueryParametersConduct + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for TranslateRequiredQueryParametersConduct + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private TranslateRequiredQueryParametersConduct(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to TranslateRequiredQueryParametersConduct + /// the value to convert to an instance of . + + public static implicit operator TranslateRequiredQueryParametersConduct(string value) + { + return new TranslateRequiredQueryParametersConduct(value); + } + + /// Implicit operator to convert TranslateRequiredQueryParametersConduct to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct e) + { + return e._value; + } + + /// Overriding != operator for enum TranslateRequiredQueryParametersConduct + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TranslateRequiredQueryParametersConduct + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.TranslateRequiredQueryParametersConduct e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/UserState.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/UserState.cs new file mode 100644 index 000000000000..e5ee8bd2734c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/UserState.cs @@ -0,0 +1,113 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal + /// or call any APIs of subscribed products. Default state is Active. + /// + public partial struct UserState : + System.IEquatable + { + /// User state is active. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState Active = @"active"; + + /// + /// User is blocked. Blocked users cannot authenticate at developer portal or call API. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState Blocked = @"blocked"; + + /// User account is closed. All identities and related entities are removed. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState Deleted = @"deleted"; + + /// + /// User account is pending. Requires identity confirmation before it can be made active. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState Pending = @"pending"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UserState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UserState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UserState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UserState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is UserState && Equals((UserState)obj); + } + + /// Returns hashCode for enum UserState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UserState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private UserState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UserState + /// the value to convert to an instance of . + + public static implicit operator UserState(string value) + { + return new UserState(value); + } + + /// Implicit operator to convert UserState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState e) + { + return e._value; + } + + /// Overriding != operator for enum UserState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UserState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.UserState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/Verbosity.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Verbosity.cs new file mode 100644 index 000000000000..8b14b5b59a88 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/Verbosity.cs @@ -0,0 +1,109 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// The verbosity level applied to traces emitted by trace policies. + public partial struct Verbosity : + System.IEquatable + { + /// + /// Only traces with 'severity' set to 'error' will be sent to the logger attached to this diagnostic instance. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity Error = @"error"; + + /// + /// Traces with 'severity' set to 'information' and 'error' will be sent to the logger attached to this diagnostic instance. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity Information = @"information"; + + /// + /// All the traces emitted by trace policies will be sent to the logger attached to this diagnostic instance. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity Verbose = @"verbose"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Verbosity + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Verbosity(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Verbosity + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Verbosity (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Verbosity && Equals((Verbosity)obj); + } + + /// Returns hashCode for enum Verbosity + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Verbosity + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Verbosity(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to Verbosity + /// the value to convert to an instance of . + + public static implicit operator Verbosity(string value) + { + return new Verbosity(value); + } + + /// Implicit operator to convert Verbosity to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity e) + { + return e._value; + } + + /// Overriding != operator for enum Verbosity + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Verbosity + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.Verbosity e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/VersioningScheme.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/VersioningScheme.cs new file mode 100644 index 000000000000..c19920bc7150 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/VersioningScheme.cs @@ -0,0 +1,105 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// An value that determines where the API Version identifier will be located in a HTTP request. + /// + public partial struct VersioningScheme : + System.IEquatable + { + /// The API Version is passed in a HTTP header. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme Header = @"Header"; + + /// The API Version is passed in a query parameter. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme Query = @"Query"; + + /// The API Version is passed in a path segment. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme Segment = @"Segment"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to VersioningScheme + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new VersioningScheme(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type VersioningScheme + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type VersioningScheme (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is VersioningScheme && Equals((VersioningScheme)obj); + } + + /// Returns hashCode for enum VersioningScheme + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for VersioningScheme + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private VersioningScheme(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to VersioningScheme + /// the value to convert to an instance of . + + public static implicit operator VersioningScheme(string value) + { + return new VersioningScheme(value); + } + + /// Implicit operator to convert VersioningScheme to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme e) + { + return e._value; + } + + /// Overriding != operator for enum VersioningScheme + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum VersioningScheme + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VersioningScheme e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/api/Support/VirtualNetworkType.cs b/swaggerci/apimanagement.DefaultTag/generated/api/Support/VirtualNetworkType.cs new file mode 100644 index 000000000000..9a1488b20679 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/api/Support/VirtualNetworkType.cs @@ -0,0 +1,110 @@ +// 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 Microsoft.Azure.PowerShell.Cmdlets.Api.Support +{ + + /// + /// The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management + /// service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network + /// having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network + /// having an Intranet Facing Endpoint only. + /// + public partial struct VirtualNetworkType : + System.IEquatable + { + /// The service is part of Virtual Network and it is accessible from Internet. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType External = @"External"; + + /// + /// The service is part of Virtual Network and it is only accessible from within the virtual network. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType Internal = @"Internal"; + + /// The service is not part of any Virtual Network. + public static Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType None = @"None"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to VirtualNetworkType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new VirtualNetworkType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type VirtualNetworkType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type VirtualNetworkType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is VirtualNetworkType && Equals((VirtualNetworkType)obj); + } + + /// Returns hashCode for enum VirtualNetworkType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for VirtualNetworkType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private VirtualNetworkType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to VirtualNetworkType + /// the value to convert to an instance of . + + public static implicit operator VirtualNetworkType(string value) + { + return new VirtualNetworkType(value); + } + + /// Implicit operator to convert VirtualNetworkType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType e) + { + return e._value; + } + + /// Overriding != operator for enum VirtualNetworkType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum VirtualNetworkType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType e1, Microsoft.Azure.PowerShell.Cmdlets.Api.Support.VirtualNetworkType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/CmdInfoHandler.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..713803f2b870 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/CmdInfoHandler.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Management.Automation; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + using NextDelegate = Func, Task>, Task>; + using SignalDelegate = Func, Task>; + + public class CmdInfoHandler + { + private readonly string processRecordId; + private readonly string parameterSetName; + private readonly InvocationInfo invocationInfo; + + public CmdInfoHandler(string processRecordId, InvocationInfo invocationInfo, string parameterSetName) + { + this.processRecordId = processRecordId; + this.parameterSetName = parameterSetName; + this.invocationInfo = invocationInfo; + } + + public Task SendAsync(HttpRequestMessage request, CancellationToken token, Action cancel, SignalDelegate signal, NextDelegate next) + { + request.Headers.Add("x-ms-client-request-id", processRecordId); + request.Headers.Add("CommandName", invocationInfo?.InvocationName); + request.Headers.Add("FullCommandName", invocationInfo?.MyCommand?.Name); + request.Headers.Add("ParameterSetName", parameterSetName); + + // continue with pipeline. + return next(request, token, cancel, signal); + } + } +} diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/ConversionException.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..40afa6b8dd95 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/ConversionException.cs @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal class ConversionException : Exception + { + internal ConversionException(string message) + : base(message) { } + + internal ConversionException(JsonNode node, Type targetType) + : base($"Cannot convert '{node.Type}' to a {targetType.Name}") { } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..20291119c8f2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/IJsonConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal interface IJsonConverter + { + JsonNode ToJson(object value); + + object FromJson(JsonNode node); + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..22369361046c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/BinaryConverter.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class BinaryConverter : JsonConverter + { + internal override JsonNode ToJson(byte[] value) => new XBinary(value); + + internal override byte[] FromJson(JsonNode node) + { + switch (node.Type) + { + case JsonType.String : return Convert.FromBase64String(node.ToString()); // Base64 Encoded + case JsonType.Binary : return ((XBinary)node).Value; + } + + throw new ConversionException(node, typeof(byte[])); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..e45bd6f2942c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/BooleanConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class BooleanConverter : JsonConverter + { + internal override JsonNode ToJson(bool value) => new JsonBoolean(value); + + internal override bool FromJson(JsonNode node) => (bool)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..146bb4b0d0dd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DateTimeConverter.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class DateTimeConverter : JsonConverter + { + internal override JsonNode ToJson(DateTime value) + { + return new JsonDate(value); + } + + internal override DateTime FromJson(JsonNode node) => (DateTime)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..27beaafd6d16 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class DateTimeOffsetConverter : JsonConverter + { + internal override JsonNode ToJson(DateTimeOffset value) => new JsonDate(value); + + internal override DateTimeOffset FromJson(JsonNode node) => (DateTimeOffset)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..de99099c95d5 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DecimalConverter.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class DecimalConverter : JsonConverter + { + internal override JsonNode ToJson(decimal value) => new JsonNumber(value.ToString()); + + internal override decimal FromJson(JsonNode node) + { + return (decimal)node; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..09fd3412b71a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/DoubleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class DoubleConverter : JsonConverter + { + internal override JsonNode ToJson(double value) => new JsonNumber(value); + + internal override double FromJson(JsonNode node) => (double)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..f24fea174dbb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/EnumConverter.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class EnumConverter : IJsonConverter + { + private readonly Type type; + + internal EnumConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + } + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + + public object FromJson(JsonNode node) + { + if (node.Type == JsonType.Number) + { + return Enum.ToObject(type, (int)node); + } + + return Enum.Parse(type, node.ToString(), ignoreCase: true); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..435aa17bd264 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/GuidConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class GuidConverter : JsonConverter + { + internal override JsonNode ToJson(Guid value) => new JsonString(value.ToString()); + + internal override Guid FromJson(JsonNode node) => (Guid)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..b1b24db55d40 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/HashSet'1Converter.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class HashSetConverter : JsonConverter> + { + internal override JsonNode ToJson(HashSet value) + { + return new XSet(value); + } + + internal override HashSet FromJson(JsonNode node) + { + var collection = node as ICollection; + + if (collection.Count == 0) return null; + + // TODO: Remove Linq depedency + return new HashSet(collection.Cast()); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..c779d38a60ae --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/Int16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class Int16Converter : JsonConverter + { + internal override JsonNode ToJson(short value) => new JsonNumber(value); + + internal override short FromJson(JsonNode node) => (short)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..b78afb1beb69 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/Int32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class Int32Converter : JsonConverter + { + internal override JsonNode ToJson(int value) => new JsonNumber(value); + + internal override int FromJson(JsonNode node) => (int)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..86d07ebd6b3b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/Int64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class Int64Converter : JsonConverter + { + internal override JsonNode ToJson(long value) => new JsonNumber(value); + + internal override long FromJson(JsonNode node) => (long)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..00ff8bc08578 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/JsonArrayConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class JsonArrayConverter : JsonConverter + { + internal override JsonNode ToJson(JsonArray value) => value; + + internal override JsonArray FromJson(JsonNode node) => (JsonArray)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..ca3e3181db8c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/JsonObjectConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class JsonObjectConverter : JsonConverter + { + internal override JsonNode ToJson(JsonObject value) => value; + + internal override JsonObject FromJson(JsonNode node) => (JsonObject)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..320d2762a43a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/SingleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class SingleConverter : JsonConverter + { + internal override JsonNode ToJson(float value) => new JsonNumber(value.ToString()); + + internal override float FromJson(JsonNode node) => (float)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..c5308fc03fb9 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/StringConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class StringConverter : JsonConverter + { + internal override JsonNode ToJson(string value) => new JsonString(value); + + internal override string FromJson(JsonNode node) => node.ToString(); + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..3ca4df61ec4d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/TimeSpanConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class TimeSpanConverter : JsonConverter + { + internal override JsonNode ToJson(TimeSpan value) => new JsonString(value.ToString()); + + internal override TimeSpan FromJson(JsonNode node) => (TimeSpan)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..be84f02134fb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UInt16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class UInt16Converter : JsonConverter + { + internal override JsonNode ToJson(ushort value) => new JsonNumber(value); + + internal override ushort FromJson(JsonNode node) => (ushort)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..034f10f1b8a7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UInt32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class UInt32Converter : JsonConverter + { + internal override JsonNode ToJson(uint value) => new JsonNumber(value); + + internal override uint FromJson(JsonNode node) => (uint)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..2a5a4052facc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UInt64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class UInt64Converter : JsonConverter + { + internal override JsonNode ToJson(ulong value) => new JsonNumber(value.ToString()); + + internal override ulong FromJson(JsonNode node) => (ulong)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..af807f7fc3e1 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/Instances/UriConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class UriConverter : JsonConverter + { + internal override JsonNode ToJson(Uri value) => new JsonString(value.AbsoluteUri); + + internal override Uri FromJson(JsonNode node) => (Uri)node; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..f30bb5738cf4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/JsonConverter.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public abstract class JsonConverter : IJsonConverter + { + internal abstract T FromJson(JsonNode node); + + internal abstract JsonNode ToJson(T value); + + #region IConverter + + object IJsonConverter.FromJson(JsonNode node) => FromJson(node); + + JsonNode IJsonConverter.ToJson(object value) => ToJson((T)value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..266cd4a25d44 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/JsonConverterAttribute.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class JsonConverterAttribute : Attribute + { + internal JsonConverterAttribute(Type type) + { + Converter = (IJsonConverter)Activator.CreateInstance(type); + } + + internal IJsonConverter Converter { get; } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..871a36005780 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/JsonConverterFactory.cs @@ -0,0 +1,91 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class JsonConverterFactory + { + private static readonly Dictionary converters = new Dictionary(); + + static JsonConverterFactory() + { + AddInternal(new BooleanConverter()); + AddInternal(new DateTimeConverter()); + AddInternal(new DateTimeOffsetConverter()); + AddInternal(new BinaryConverter()); + AddInternal(new DecimalConverter()); + AddInternal(new DoubleConverter()); + AddInternal(new GuidConverter()); + AddInternal(new Int16Converter()); + AddInternal(new Int32Converter()); + AddInternal(new Int64Converter()); + AddInternal(new SingleConverter()); + AddInternal(new StringConverter()); + AddInternal(new TimeSpanConverter()); + AddInternal(new UInt16Converter()); + AddInternal(new UInt32Converter()); + AddInternal(new UInt64Converter()); + AddInternal(new UriConverter()); + + // Hash sets + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + + // JSON + + AddInternal(new JsonObjectConverter()); + AddInternal(new JsonArrayConverter()); + } + + internal static Dictionary Instances => converters; + + internal static IJsonConverter Get(Type type) + { + var details = TypeDetails.Get(type); + + if (details.JsonConverter == null) + { + throw new ConversionException($"No converter found for '{type.Name}'."); + } + + return details.JsonConverter; + } + + internal static bool TryGet(Type type, out IJsonConverter converter) + { + var typeDetails = TypeDetails.Get(type); + + converter = typeDetails.JsonConverter; + + return converter != null; + } + + private static void AddInternal(JsonConverter converter) + => converters.Add(typeof(T), converter); + + private static void AddInternal(IJsonConverter converter) + => converters.Add(typeof(T), converter); + + internal static void Add(JsonConverter converter) + { + if (converter == null) + { + throw new ArgumentNullException(nameof(converter)); + } + + AddInternal(converter); + + var type = TypeDetails.Get(); + + type.JsonConverter = converter; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..465a2dad2988 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Conversions/StringLikeConverter.cs @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class StringLikeConverter : IJsonConverter + { + private readonly Type type; + private readonly MethodInfo parseMethod; + + internal StringLikeConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + this.parseMethod = StringLikeHelper.GetParseMethod(type); + } + + public object FromJson(JsonNode node) => + parseMethod.Invoke(null, new[] { node.ToString() }); + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + } + + internal static class StringLikeHelper + { + private static readonly Type[] parseMethodParamaterTypes = new[] { typeof(string) }; + + internal static bool IsStringLike(Type type) + { + return GetParseMethod(type) != null; + } + + internal static MethodInfo GetParseMethod(Type type) + { + MethodInfo method = type.GetMethod("Parse", parseMethodParamaterTypes); + + if (method?.IsPublic != true) return null; + + return method; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..99435bbaebe6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/IJsonSerializable.cs @@ -0,0 +1,263 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + public interface IJsonSerializable + { + JsonNode ToJson(JsonObject container = null, SerializationMode serializationMode = SerializationMode.None); + } + internal static class JsonSerializable + { + /// + /// Serializes an enumerable and returns a JsonNode. + /// + /// an IEnumerable collection of items + /// A JsonNode that contains the collection of items serialized. + private static JsonNode ToJsonValue(System.Collections.IEnumerable enumerable) + { + if (enumerable != null) + { + // is it a byte array of some kind? + if (enumerable is System.Collections.Generic.IEnumerable byteEnumerable) + { + return new XBinary(System.Linq.Enumerable.ToArray(byteEnumerable)); + } + + var hasValues = false; + // just create an array of value nodes. + var result = new XNodeArray(); + foreach (var each in enumerable) + { + // we had at least one value. + hasValues = true; + + // try to serialize it. + var node = ToJsonValue(each); + if (null != node) + { + result.Add(node); + } + } + + // if we were able to add values, (or it was just empty), return it. + if (result.Count > 0 || !hasValues) + { + return result; + } + } + + // we couldn't serialize the values. Sorry. + return null; + } + + /// + /// Serializes a valuetype to a JsonNode. + /// + /// a ValueType (ie, a primitive, enum or struct) to be serialized + /// a JsonNode with the serialized value + private static JsonNode ToJsonValue(ValueType vValue) + { + // numeric type + if (vValue is SByte || vValue is Int16 || vValue is Int32 || vValue is Int64 || vValue is Byte || vValue is UInt16 || vValue is UInt32 || vValue is UInt64 || vValue is decimal || vValue is float || vValue is double) + { + return new JsonNumber(vValue.ToString()); + } + + // boolean type + if (vValue is bool bValue) + { + return new JsonBoolean(bValue); + } + + // dates + if (vValue is DateTime dtValue) + { + return new JsonDate(dtValue); + } + + // DictionaryEntity struct type + if (vValue is System.Collections.DictionaryEntry deValue) + { + return new JsonObject { { deValue.Key.ToString(), ToJsonValue(deValue.Value) } }; + } + + // sorry, no idea. + return null; + } + /// + /// Attempts to serialize an object by using ToJson() or ToJsonString() if they exist. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + private static JsonNode TryToJsonValue(dynamic oValue) + { + object jsonValue = null; + dynamic v = oValue; + try + { + jsonValue = v.ToJson().ToString(); + } + catch + { + // no harm... + try + { + jsonValue = v.ToJsonString().ToString(); + } + catch + { + // no worries here either. + } + } + + // if we got something out, let's use it. + if (null != jsonValue) + { + // JsonNumber is really a literal json value. Just don't try to cast that back to an actual number, ok? + return new JsonNumber(jsonValue.ToString()); + } + + return null; + } + + /// + /// Serialize an object by using a variety of methods. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + internal static JsonNode ToJsonValue(object value) + { + // things that implement our interface are preferred. + if (value is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IJsonSerializable jsonSerializable) + { + return jsonSerializable.ToJson(); + } + + // strings are easy. + if (value is string || value is char) + { + return new JsonString(value.ToString()); + } + + // value types are fairly straightforward (fallback to ToJson()/ToJsonString() or literal JsonString ) + if (value is System.ValueType vValue) + { + return ToJsonValue(vValue) ?? TryToJsonValue(vValue) ?? new JsonString(vValue.ToString()); + } + + // dictionaries are objects that should be able to serialize + if (value is System.Collections.Generic.IDictionary dictionary) + { + return Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson(dictionary, null); + } + + // hashtables are converted to dictionaries for serialization + if (value is System.Collections.Hashtable hashtable) + { + var dict = new System.Collections.Generic.Dictionary(); + DictionaryExtensions.HashTableToDictionary(hashtable, dict); + return Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.ToJson(dict, null); + } + + // enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString) + if (value is System.Collections.IEnumerable enumerableValue) + { + // some kind of enumerable value + return ToJsonValue(enumerableValue) ?? TryToJsonValue(value) ?? new JsonString(value.ToString()); + } + + // at this point, we're going to fallback to a string literal here, since we really have no idea what it is. + return new JsonString(value.ToString()); + } + + internal static JsonObject ToJson(System.Collections.Generic.Dictionary dictionary, JsonObject container) => ToJson((System.Collections.Generic.IDictionary)dictionary, container); + + /// + /// Serializes a dictionary into a JsonObject container. + /// + /// The dictionary to serailize + /// the container to serialize the dictionary into + /// the container + internal static JsonObject ToJson(System.Collections.Generic.IDictionary dictionary, JsonObject container) + { + container = container ?? new JsonObject(); + if (dictionary != null && dictionary.Count > 0) + { + foreach (var key in dictionary) + { + // currently, we don't serialize null values. + if (null != key.Value) + { + container.Add(key.Key, ToJsonValue(key.Value)); + continue; + } + } + } + return container; + } + + internal static Func> DeserializeDictionary(Func> dictionaryFactory) + { + return (node) => FromJson(node, dictionaryFactory(), (object)(DeserializeDictionary(dictionaryFactory)) as Func); + } + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.Dictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) => FromJson(json, (System.Collections.Generic.IDictionary)container, objectFactory, excludes); + + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.IDictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) + { + if (null == json) + { + return container; + } + + foreach (var key in json.Keys) + { + if (true == excludes?.Contains(key)) + { + continue; + } + + var value = json[key]; + try + { + switch (value.Type) + { + case JsonType.Null: + // skip null values. + continue; + + case JsonType.Array: + case JsonType.Boolean: + case JsonType.Date: + case JsonType.Binary: + case JsonType.Number: + case JsonType.String: + container.Add(key, (V)value.ToValue()); + break; + case JsonType.Object: + if (objectFactory != null) + { + var v = objectFactory(value as JsonObject); + if (null != v) + { + container.Add(key, v); + } + } + break; + } + } + catch + { + } + } + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonArray.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..3974fcaa36e7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonArray.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public partial class JsonArray + { + internal override object ToValue() => Count == 0 ? new object[0] : System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(this, each => each.ToValue())); + } + + +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..2284235e800b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonBoolean.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal partial class JsonBoolean + { + internal static JsonBoolean Create(bool? value) => value is bool b ? new JsonBoolean(b) : null; + internal bool ToBoolean() => Value; + + internal override object ToValue() => Value; + } + + +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonNode.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..c8dfb086100a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonNode.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonNode + { + /// + /// Returns the content of this node as the underlying value. + /// Will default to the string representation if not overridden in child classes. + /// + /// an object with the underlying value of the node. + internal virtual object ToValue() { + return this.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..5df1675401b3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonNumber.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + using System; + + public partial class JsonNumber + { + internal static readonly DateTime EpochDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + private static long ToUnixTime(DateTime dateTime) + { + return (long)dateTime.Subtract(EpochDate).TotalSeconds; + } + private static DateTime FromUnixTime(long totalSeconds) + { + return EpochDate.AddSeconds(totalSeconds); + } + internal byte ToByte() => this; + internal int ToInt() => this; + internal long ToLong() => this; + internal short ToShort() => this; + internal UInt16 ToUInt16() => this; + internal UInt32 ToUInt32() => this; + internal UInt64 ToUInt64() => this; + internal decimal ToDecimal() => this; + internal double ToDouble() => this; + internal float ToFloat() => this; + + internal static JsonNumber Create(int? value) => value is int n ? new JsonNumber(n) : null; + internal static JsonNumber Create(long? value) => value is long n ? new JsonNumber(n) : null; + internal static JsonNumber Create(float? value) => value is float n ? new JsonNumber(n) : null; + internal static JsonNumber Create(double? value) => value is double n ? new JsonNumber(n) : null; + internal static JsonNumber Create(decimal? value) => value is decimal n ? new JsonNumber(n) : null; + internal static JsonNumber Create(DateTime? value) => value is DateTime date ? new JsonNumber(ToUnixTime(date)) : null; + + public static implicit operator DateTime(JsonNumber number) => FromUnixTime(number); + internal DateTime ToDateTime() => this; + + internal JsonNumber(decimal value) + { + this.value = value.ToString(); + } + internal override object ToValue() + { + if (IsInteger) + { + if (int.TryParse(this.value, out int iValue)) + { + return iValue; + } + if (long.TryParse(this.value, out long lValue)) + { + return lValue; + } + } + else + { + if (float.TryParse(this.value, out float fValue)) + { + return fValue; + } + if (double.TryParse(this.value, out double dValue)) + { + return dValue; + } + if (decimal.TryParse(this.value, out decimal dcValue)) + { + return dcValue; + } + } + return null; + } + } + + +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonObject.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..4d46b4972034 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonObject.cs @@ -0,0 +1,183 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonObject + { + internal override object ToValue() => Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.JsonSerializable.FromJson(this, new System.Collections.Generic.Dictionary(), (obj) => obj.ToValue()); + + internal void SafeAdd(string name, Func valueFn) + { + if (valueFn != null) + { + var value = valueFn(); + if (null != value) + { + items.Add(name, value); + } + } + } + + internal void SafeAdd(string name, JsonNode value) + { + if (null != value) + { + items.Add(name, value); + } + } + + internal T NullableProperty(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; + } + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + //throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal JsonObject Property(string propertyName) + { + return PropertyT(propertyName); + } + + internal T PropertyT(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; // we're going to assume that the consumer knows what to do if null is explicity returned? + } + + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + // throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal int NumberProperty(string propertyName, ref int output) => output = this.PropertyT(propertyName)?.ToInt() ?? output; + internal float NumberProperty(string propertyName, ref float output) => output = this.PropertyT(propertyName)?.ToFloat() ?? output; + internal byte NumberProperty(string propertyName, ref byte output) => output = this.PropertyT(propertyName)?.ToByte() ?? output; + internal long NumberProperty(string propertyName, ref long output) => output = this.PropertyT(propertyName)?.ToLong() ?? output; + internal double NumberProperty(string propertyName, ref double output) => output = this.PropertyT(propertyName)?.ToDouble() ?? output; + internal decimal NumberProperty(string propertyName, ref decimal output) => output = this.PropertyT(propertyName)?.ToDecimal() ?? output; + internal short NumberProperty(string propertyName, ref short output) => output = this.PropertyT(propertyName)?.ToShort() ?? output; + internal DateTime NumberProperty(string propertyName, ref DateTime output) => output = this.PropertyT(propertyName)?.ToDateTime() ?? output; + + internal int? NumberProperty(string propertyName, ref int? output) => output = this.NullableProperty(propertyName)?.ToInt() ?? null; + internal float? NumberProperty(string propertyName, ref float? output) => output = this.NullableProperty(propertyName)?.ToFloat() ?? null; + internal byte? NumberProperty(string propertyName, ref byte? output) => output = this.NullableProperty(propertyName)?.ToByte() ?? null; + internal long? NumberProperty(string propertyName, ref long? output) => output = this.NullableProperty(propertyName)?.ToLong() ?? null; + internal double? NumberProperty(string propertyName, ref double? output) => output = this.NullableProperty(propertyName)?.ToDouble() ?? null; + internal decimal? NumberProperty(string propertyName, ref decimal? output) => output = this.NullableProperty(propertyName)?.ToDecimal() ?? null; + internal short? NumberProperty(string propertyName, ref short? output) => output = this.NullableProperty(propertyName)?.ToShort() ?? null; + + internal DateTime? NumberProperty(string propertyName, ref DateTime? output) => output = this.NullableProperty(propertyName)?.ToDateTime() ?? null; + + + internal string StringProperty(string propertyName) => this.PropertyT(propertyName)?.ToString(); + internal string StringProperty(string propertyName, ref string output) => output = this.PropertyT(propertyName)?.ToString() ?? output; + internal char StringProperty(string propertyName, ref char output) => output = this.PropertyT(propertyName)?.ToChar() ?? output; + internal char? StringProperty(string propertyName, ref char? output) => output = this.PropertyT(propertyName)?.ToChar() ?? null; + + internal DateTime StringProperty(string propertyName, ref DateTime output) => DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out output) ? output : output; + internal DateTime? StringProperty(string propertyName, ref DateTime? output) => output = DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out var o) ? o : output; + + + internal bool BooleanProperty(string propertyName, ref bool output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? output; + internal bool? BooleanProperty(string propertyName, ref bool? output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? null; + + internal T[] ArrayProperty(string propertyName, ref T[] output, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + } + return output; + } + internal T[] ArrayProperty(string propertyName, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + var output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + return output; + } + return new T[0]; + } + internal void IterateArrayProperty(string propertyName, Action deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + for (var i = 0; i < array.Count; i++) + { + deserializer(array[i]); + } + } + } + + internal Dictionary DictionaryProperty(string propertyName, ref Dictionary output, Func deserializer) + { + var dictionary = this.PropertyT(propertyName); + if (output == null) + { + output = new Dictionary(); + } + else + { + output.Clear(); + } + if (dictionary != null) + { + foreach (var key in dictionary.Keys) + { + output[key] = deserializer(dictionary[key]); + } + } + return output; + } + + internal static JsonObject Create(IDictionary source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new JsonObject(); + + foreach (var key in source.Keys) + { + result.SafeAdd(key, selector(source[key])); + } + return result; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonString.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..15bb993a4fcc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/JsonString.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + using System; + using System.Globalization; + using System.Linq; + + public partial class JsonString + { + internal static string DateFormat = "yyyy-MM-dd"; + internal static string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; + internal static string DateTimeRfc1123Format = "R"; + + internal static JsonString Create(string value) => value == null ? null : new JsonString(value); + internal static JsonString Create(char? value) => value is char c ? new JsonString(c.ToString()) : null; + + internal static JsonString CreateDate(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTime(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTimeRfc1123(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeRfc1123Format, CultureInfo.CurrentCulture)) : null; + + internal char ToChar() => this.Value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char(JsonString value) => value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char? (JsonString value) => value?.ToString()?.FirstOrDefault(); + + public static implicit operator DateTime(JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime); + public static implicit operator DateTime? (JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime?); + + } + + +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..b54538ed137a --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Customizations/XNodeArray.cs @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + using System; + using System.Linq; + + public partial class XNodeArray + { + internal static XNodeArray Create(T[] source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new XNodeArray(); + foreach (var item in source.Select(selector)) + { + result.SafeAdd(item); + } + return result; + } + internal void SafeAdd(JsonNode item) + { + if (item != null) + { + items.Add(item); + } + } + internal void SafeAdd(Func itemFn) + { + if (itemFn != null) + { + var item = itemFn(); + if (item != null) + { + items.Add(item); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/EventData.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/EventData.cs new file mode 100644 index 000000000000..f65d9e28c50e --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/EventData.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + + using System; + using System.Threading; + + ///Represents the data in signaled event. + public partial class EventData + { + /// + /// The type of the event being signaled + /// + public string Id; + + /// + /// The user-ready message from the event. + /// + public string Message; + + /// + /// When the event is about a parameter, this is the parameter name. + /// Used in Validation Events + /// + public string Parameter; + + /// + /// This represents a numeric value associated with the event. + /// Use for progress-style events + /// + public double Value; + + /// + /// Any extended data for an event should be serialized and stored here. + /// + public string ExtendedData; + + /// + /// If the event triggers after the request message has been created, this will contain the Request Message (which in HTTP calls would be HttpRequestMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.RequestMessgae is HttpRequestMessage httpRequest) + /// { + /// httpRequest.Headers.Add("x-request-flavor", "vanilla"); + /// } + /// + /// + public object RequestMessage; + + /// + /// If the event triggers after the response is back, this will contain the Response Message (which in HTTP calls would be HttpResponseMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.ResponseMessage is HttpResponseMessage httpResponse){ + /// var flavor = httpResponse.Headers.GetValue("x-request-flavor"); + /// } + /// + /// + public object ResponseMessage; + + /// + /// Cancellation method for this event. + /// + /// If the event consumer wishes to cancel the request that initiated this event, call Cancel() + /// + /// + /// The original initiator of the request must provide the implementation of this. + /// + public System.Action Cancel; + } + +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/EventListener.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..eb581f4d8c34 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/EventListener.cs @@ -0,0 +1,247 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public interface IValidates + { + Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IEventListener listener); + } + + /// + /// The IEventListener Interface defines the communication mechanism for Signaling events during a remote call. + /// + /// + /// The interface is designed to be as minimal as possible, allow for quick peeking of the event type (id) + /// and the cancellation status and provides a delegate for retrieving the event details themselves. + /// + public interface IEventListener + { + Task Signal(string id, CancellationToken token, GetEventData createMessage); + CancellationToken Token { get; } + System.Action Cancel { get; } + } + + internal static partial class Extensions + { + public static Task Signal(this IEventListener instance, string id, CancellationToken token, Func createMessage) => instance.Signal(id, token, createMessage); + public static Task Signal(this IEventListener instance, string id, CancellationToken token) => instance.Signal(id, token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, EventData message) => instance.Signal(id, token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, Func createMessage) => instance.Signal(id, instance.Token, createMessage); + public static Task Signal(this IEventListener instance, string id) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, EventData message) => instance.Signal(id, instance.Token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, System.Uri uri) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = uri.ToString(), Cancel = instance.Cancel }); + + public static async Task AssertNotNull(this IEventListener instance, string parameterName, object value) + { + if (value == null) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' should not be null", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMinimumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length < length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is less than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMaximumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length > length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is greater than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + + public static async Task AssertRegEx(this IEventListener instance, string parameterName, string value, string regularExpression) + { + if (value != null && !System.Text.RegularExpressions.Regex.Match(value, regularExpression).Success) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' does not validate against pattern /{regularExpression}/", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertEnum(this IEventListener instance, string parameterName, string value, params string[] values) + { + if (!values.Any(each => each.Equals(value))) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' is not one of ({values.Aggregate((c, e) => $"'{e}',{c}")}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertObjectIsValid(this IEventListener instance, string parameterName, object inst) + { + await (inst as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.IValidates)?.Validate(instance); + } + + public static async Task AssertIsLessThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) >= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) <= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsLessThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) > 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) < 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, Int64? value, Int64 multiple) + { + if (null != value && value % multiple != 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, double? value, double multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, decimal? value, decimal multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + } + + /// + /// An Implementation of the IEventListener that supports subscribing to events and dispatching them + /// (used for manually using the lowlevel interface) + /// + public class EventListener : CancellationTokenSource, IEnumerable>, IEventListener + { + private Dictionary calls = new Dictionary(); + public IEnumerator> GetEnumerator() => calls.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => calls.GetEnumerator(); + public EventListener() + { + } + + public new Action Cancel => base.Cancel; + private Event tracer; + + public EventListener(params (string name, Event callback)[] initializer) + { + foreach (var each in initializer) + { + Add(each.name, each.callback); + } + } + + public void Add(string name, SynchEvent callback) + { + Add(name, (message) => { callback(message); return Task.CompletedTask; }); + } + + public void Add(string name, Event callback) + { + if (callback != null) + { + if (string.IsNullOrEmpty(name)) + { + if (calls.ContainsKey(name)) + { + tracer += callback; + } + else + { + tracer = callback; + } + } + else + { + if (calls.ContainsKey(name)) + { + calls[name ?? System.String.Empty] += callback; + } + else + { + calls[name ?? System.String.Empty] = callback; + } + } + } + } + + + public async Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + using (NoSynchronizationContext) + { + if (!string.IsNullOrEmpty(id) && (calls.TryGetValue(id, out Event listener) || tracer != null)) + { + var message = createMessage(); + message.Id = id; + + await listener?.Invoke(message); + await tracer?.Invoke(message); + + if (token.IsCancellationRequested) + { + throw new OperationCanceledException($"Canceled by event {id} ", this.Token); + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Events.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Events.cs new file mode 100644 index 000000000000..bbb4688cbcc6 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Events.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + public static partial class Events + { + public const string Log = nameof(Log); + public const string Validation = nameof(Validation); + public const string ValidationWarning = nameof(ValidationWarning); + public const string AfterValidation = nameof(AfterValidation); + public const string RequestCreated = nameof(RequestCreated); + public const string ResponseCreated = nameof(ResponseCreated); + public const string URLCreated = nameof(URLCreated); + public const string Finally = nameof(Finally); + public const string HeaderParametersAdded = nameof(HeaderParametersAdded); + public const string BodyContentSet = nameof(BodyContentSet); + public const string BeforeCall = nameof(BeforeCall); + public const string BeforeResponseDispatch = nameof(BeforeResponseDispatch); + public const string FollowingNextLink = nameof(FollowingNextLink); + public const string DelayBeforePolling = nameof(DelayBeforePolling); + public const string Polling = nameof(Polling); + + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Extensions.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..2948c04c2506 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Extensions.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + using System.Linq; + using System; + + internal static partial class Extensions + { + public static T[] SubArray(this T[] array, int offset, int length) + { + return new ArraySegment(array, offset, length) + .ToArray(); + } + + public static T ReadHeaders(this T instance, global::System.Net.Http.Headers.HttpResponseHeaders headers) where T : class + { + (instance as IHeaderSerializable)?.ReadHeaders(headers); + return instance; + } + + internal static bool If(T input, out T output) + { + if (null == input) + { + output = default(T); + return false; + } + output = input; + return true; + } + + internal static void AddIf(T value, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(value); + } + } + + internal static void AddIf(T value, string serializedName, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(serializedName, value); + } + } + + /// + /// Returns the first header value as a string from an HttpReponseMessage. + /// + /// the HttpResponseMessage to fetch a header from + /// the header name + /// the first header value as a string from an HttpReponseMessage. string.empty if there is no header value matching + internal static string GetFirstHeader(this System.Net.Http.HttpResponseMessage response, string headerName) => response.Headers.FirstOrDefault(each => string.Equals(headerName, each.Key, System.StringComparison.OrdinalIgnoreCase)).Value?.FirstOrDefault() ?? string.Empty; + + /// + /// Sets the Synchronization Context to null, and returns an IDisposable that when disposed, + /// will restore the synchonization context to the original value. + /// + /// This is used a less-invasive means to ensure that code in the library that doesn't + /// need to be continued in the original context doesn't have to have ConfigureAwait(false) + /// on every single await + /// + /// If the SynchronizationContext is null when this is used, the resulting IDisposable + /// will not do anything (this prevents excessive re-setting of the SynchronizationContext) + /// + /// Usage: + /// + /// using(NoSynchronizationContext) { + /// await SomeAsyncOperation(); + /// await SomeOtherOperation(); + /// } + /// + /// + /// + /// An IDisposable that will return the SynchronizationContext to original state + internal static System.IDisposable NoSynchronizationContext => System.Threading.SynchronizationContext.Current == null ? Dummy : new NoSyncContext(); + + /// + /// An instance of the Dummy IDispoable. + /// + /// + internal static System.IDisposable Dummy = new DummyDisposable(); + + /// + /// An IDisposable that does absolutely nothing. + /// + internal class DummyDisposable : System.IDisposable + { + public void Dispose() + { + } + } + /// + /// An IDisposable that saves the SynchronizationContext,sets it to null and + /// restores it to the original upon Dispose(). + /// + /// NOTE: This is designed to be less invasive than using .ConfigureAwait(false) + /// on every single await in library code (ie, places where we know we don't need + /// to continue in the same context as we went async) + /// + internal class NoSyncContext : System.IDisposable + { + private System.Threading.SynchronizationContext original = System.Threading.SynchronizationContext.Current; + internal NoSyncContext() + { + System.Threading.SynchronizationContext.SetSynchronizationContext(null); + } + public void Dispose() => System.Threading.SynchronizationContext.SetSynchronizationContext(original); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..968839296ccd --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal static class StringBuilderExtensions + { + /// + /// Extracts the buffered value and resets the buffer + /// + internal static string Extract(this StringBuilder builder) + { + var text = builder.ToString(); + + builder.Clear(); + + return text; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..ffff6794f1f3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/Extensions/TypeExtensions.cs @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal static class TypeExtensions + { + internal static bool IsNullable(this Type type) => + type.IsGenericType && type.GetGenericTypeDefinition().Equals(typeof(Nullable<>)); + + internal static Type GetOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition() == openGenericInterfaceType) + { + return candidateType; + } + + // Check if it references it's own converter.... + + foreach (Type interfaceType in candidateType.GetInterfaces()) + { + if (interfaceType.IsGenericType + && interfaceType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return interfaceType; + } + } + + return null; + } + + // Author: Sebastian Good + // http://stackoverflow.com/questions/503263/how-to-determine-if-a-type-implements-a-specific-generic-interface-type + internal static bool ImplementsOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + if (candidateType.Equals(openGenericInterfaceType)) + { + return true; + } + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return true; + } + + foreach (Type i in candidateType.GetInterfaces()) + { + if (i.IsGenericType && i.ImplementsOpenGenericInterface(openGenericInterfaceType)) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/Seperator.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..de8522a0a450 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/Seperator.cs @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal static class Seperator + { + internal static readonly char[] Dash = { '-' }; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..583aa9485563 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/TypeDetails.cs @@ -0,0 +1,116 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + + + + internal class TypeDetails + { + private readonly Type info; + + internal TypeDetails(Type info) + { + this.info = info ?? throw new ArgumentNullException(nameof(info)); + } + + internal Type NonNullType { get; set; } + + internal object DefaultValue { get; set; } + + internal bool IsNullable { get; set; } + + internal bool IsList { get; set; } + + internal bool IsStringLike { get; set; } + + internal bool IsEnum => info.IsEnum; + + internal bool IsArray => info.IsArray; + + internal bool IsValueType => info.IsValueType; + + internal Type ElementType { get; set; } + + internal IJsonConverter JsonConverter { get; set; } + + #region Creation + + private static readonly ConcurrentDictionary cache = new ConcurrentDictionary(); + + internal static TypeDetails Get() => Get(typeof(T)); + + internal static TypeDetails Get(Type type) => cache.GetOrAdd(type, Create); + + private static TypeDetails Create(Type type) + { + var isGenericList = !type.IsPrimitive && type.ImplementsOpenGenericInterface(typeof(IList<>)); + var isList = !type.IsPrimitive && (isGenericList || typeof(IList).IsAssignableFrom(type)); + + var isNullable = type.IsNullable(); + + Type elementType; + + if (type.IsArray) + { + elementType = type.GetElementType(); + } + else if (isGenericList) + { + var iList = type.GetOpenGenericInterface(typeof(IList<>)); + + elementType = iList.GetGenericArguments()[0]; + } + else + { + elementType = null; + } + + var nonNullType = isNullable ? type.GetGenericArguments()[0] : type; + + var isStringLike = false; + + IJsonConverter converter; + + var jsonConverterAttribute = type.GetCustomAttribute(); + + if (jsonConverterAttribute != null) + { + converter = jsonConverterAttribute.Converter; + } + else if (nonNullType.IsEnum) + { + converter = new EnumConverter(nonNullType); + } + else if (JsonConverterFactory.Instances.TryGetValue(nonNullType, out converter)) + { + } + else if (StringLikeHelper.IsStringLike(nonNullType)) + { + isStringLike = true; + + converter = new StringLikeConverter(nonNullType); + } + + return new TypeDetails(nonNullType) { + NonNullType = nonNullType, + DefaultValue = type.IsValueType ? Activator.CreateInstance(type) : null, + IsNullable = isNullable, + IsList = isList, + IsStringLike = isStringLike, + ElementType = elementType, + JsonConverter = converter + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/XHelper.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..dc536755fb9b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Helpers/XHelper.cs @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal static class XHelper + { + internal static JsonNode Create(JsonType type, TypeCode code, object value) + { + switch (type) + { + case JsonType.Binary : return new XBinary((byte[])value); + case JsonType.Boolean : return new JsonBoolean((bool)value); + case JsonType.Number : return new JsonNumber(value.ToString()); + case JsonType.String : return new JsonString((string)value); + } + + throw new Exception($"JsonType '{type}' does not have a fast conversion"); + } + + internal static bool TryGetElementType(TypeCode code, out JsonType type) + { + switch (code) + { + case TypeCode.Boolean : type = JsonType.Boolean; return true; + case TypeCode.Byte : type = JsonType.Number; return true; + case TypeCode.DateTime : type = JsonType.Date; return true; + case TypeCode.Decimal : type = JsonType.Number; return true; + case TypeCode.Double : type = JsonType.Number; return true; + case TypeCode.Empty : type = JsonType.Null; return true; + case TypeCode.Int16 : type = JsonType.Number; return true; + case TypeCode.Int32 : type = JsonType.Number; return true; + case TypeCode.Int64 : type = JsonType.Number; return true; + case TypeCode.SByte : type = JsonType.Number; return true; + case TypeCode.Single : type = JsonType.Number; return true; + case TypeCode.String : type = JsonType.String; return true; + case TypeCode.UInt16 : type = JsonType.Number; return true; + case TypeCode.UInt32 : type = JsonType.Number; return true; + case TypeCode.UInt64 : type = JsonType.Number; return true; + } + + type = default; + + return false; + } + + internal static JsonType GetElementType(TypeCode code) + { + switch (code) + { + case TypeCode.Boolean : return JsonType.Boolean; + case TypeCode.Byte : return JsonType.Number; + case TypeCode.DateTime : return JsonType.Date; + case TypeCode.Decimal : return JsonType.Number; + case TypeCode.Double : return JsonType.Number; + case TypeCode.Empty : return JsonType.Null; + case TypeCode.Int16 : return JsonType.Number; + case TypeCode.Int32 : return JsonType.Number; + case TypeCode.Int64 : return JsonType.Number; + case TypeCode.SByte : return JsonType.Number; + case TypeCode.Single : return JsonType.Number; + case TypeCode.String : return JsonType.String; + case TypeCode.UInt16 : return JsonType.Number; + case TypeCode.UInt32 : return JsonType.Number; + case TypeCode.UInt64 : return JsonType.Number; + default : return JsonType.Object; + } + + throw new Exception($"TypeCode '{code}' does not have a fast converter"); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/IAssociativeArray.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..ca98ced22f1b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/IAssociativeArray.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +#define DICT_PROPERTIES +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + /// A subset of IDictionary that doesn't implement IEnumerable or IDictionary to work around PowerShell's aggressive formatter + public interface IAssociativeArray + { +#if DICT_PROPERTIES + System.Collections.Generic.IEnumerable Keys { get; } + System.Collections.Generic.IEnumerable Values { get; } + int Count { get; } +#endif + System.Collections.Generic.IDictionary AdditionalProperties { get; } + T this[string index] { get; set; } + void Add(string key, T value); + bool ContainsKey(string key); + bool Remove(string key); + bool TryGetValue(string key, out T value); + void Clear(); + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/IHeaderSerializable.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..67db70682048 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/IHeaderSerializable.cs @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + public interface IHeaderSerializable + { + void ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers); + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/ISendAsync.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..1951373dcf9c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/ISendAsync.cs @@ -0,0 +1,300 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + /// + /// The interface for sending an HTTP request across the wire. + /// + public interface ISendAsync + { + Task SendAsync(HttpRequestMessage request, IEventListener callback); + } + + public class SendAsyncTerminalFactory : ISendAsyncTerminalFactory, ISendAsync + { + SendAsync implementation; + + public SendAsyncTerminalFactory(SendAsync implementation) => this.implementation = implementation; + public SendAsyncTerminalFactory(ISendAsync implementation) => this.implementation = implementation.SendAsync; + public ISendAsync Create() => this; + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback); + } + + public partial class SendAsyncFactory : ISendAsyncFactory + { + public class Sender : ISendAsync + { + internal ISendAsync next; + internal SendAsyncStep implementation; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback, next); + } + SendAsyncStep implementation; + + public SendAsyncFactory(SendAsyncStep implementation) => this.implementation = implementation; + public ISendAsync Create(ISendAsync next) => new Sender { next = next, implementation = implementation }; + + } + + public class HttpClientFactory : ISendAsyncTerminalFactory, ISendAsync + { + HttpClient client; + public HttpClientFactory() : this(new HttpClient()) + { + } + public HttpClientFactory(HttpClient client) => this.client = client; + public ISendAsync Create() => this; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, callback.Token); + } + + public interface ISendAsyncFactory + { + ISendAsync Create(ISendAsync next); + } + + public interface ISendAsyncTerminalFactory + { + ISendAsync Create(); + } + + public partial class HttpPipeline : ISendAsync + { + private ISendAsync pipeline; + private ISendAsyncTerminalFactory terminal; + private List steps = new List(); + + public HttpPipeline() : this(new HttpClientFactory()) + { + } + + public HttpPipeline(ISendAsyncTerminalFactory terminalStep) + { + if (terminalStep == null) + { + throw new System.ArgumentNullException(nameof(terminalStep), "Terminal Step Factory in HttpPipeline may not be null"); + } + TerminalFactory = terminalStep; + } + + /// + /// Returns an HttpPipeline with the current state of this pipeline. + /// + public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + + public ISendAsyncTerminalFactory TerminalFactory + { + get => terminal; + set + { + if (value == null) + { + throw new System.ArgumentNullException("TerminalFactory in HttpPipeline may not be null"); + } + terminal = value; + } + } + + public ISendAsync Pipeline + { + get + { + // if the pipeline has been created and not invalidated, return it. + if (this.pipeline != null) + { + return this.pipeline; + } + + // create the pipeline from scratch. + var next = terminal.Create(); + foreach (var factory in steps) + { + // skip factories that return null. + next = factory.Create(next) ?? next; + } + return this.pipeline = next; + } + } + + public int Count => steps.Count; + + public HttpPipeline Prepend(ISendAsyncFactory item) + { + if (item != null) + { + steps.Add(item); + pipeline = null; + } + return this; + } + + public HttpPipeline Append(SendAsyncStep item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStep item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Append(ISendAsyncFactory item) + { + if (item != null) + { + steps.Insert(0, item); + pipeline = null; + } + return this; + } + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(item); + } + } + return this; + } + + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(item); + } + } + return this; + } + + // you can use this as the ISendAsync Implementation + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => Pipeline.SendAsync(request, callback); + } + + internal static partial class Extensions + { + internal static HttpRequestMessage CloneAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.Clone(requestUri, method); + } + } + + internal static Task CloneWithContentAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.CloneWithContent(requestUri, method); + } + } + + /// + /// Clones an HttpRequestMessage (without the content) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// + /// + /// A clone of the HttpRequestMessage + internal static HttpRequestMessage Clone(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = new HttpRequestMessage + { + Method = method ?? original.Method, + RequestUri = requestUri ?? original.RequestUri, + Version = original.Version, + }; + + foreach (KeyValuePair prop in original.Properties) + { + clone.Properties.Add(prop); + } + + foreach (KeyValuePair> header in original.Headers) + { + /* + **temporarily skip cloning telemetry related headers** + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + */ + if (!"x-ms-unique-id".Equals(header.Key) && !"x-ms-client-request-id".Equals(header.Key) && !"CommandName".Equals(header.Key) && !"FullCommandName".Equals(header.Key) && !"ParameterSetName".Equals(header.Key) && !"User-Agent".Equals(header.Key)) + { + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + } + + return clone; + } + + /// + /// Clones an HttpRequestMessage (including the content stream and content headers) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// + /// + /// A clone of the HttpRequestMessage + internal static async Task CloneWithContent(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = original.Clone(requestUri, method); + var stream = new System.IO.MemoryStream(); + if (original.Content != null) + { + await original.Content.CopyToAsync(stream).ConfigureAwait(false); + stream.Position = 0; + clone.Content = new StreamContent(stream); + if (original.Content.Headers != null) + { + foreach (var h in original.Content.Headers) + { + clone.Content.Headers.Add(h.Key, h.Value); + } + } + } + return clone; + } + } +} diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/InfoAttribute.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..a54aaf9bca9b --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/InfoAttribute.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + using System; + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class)] + public class InfoAttribute : Attribute + { + public bool Required { get; set; } = false; + public bool ReadOnly { get; set; } = false; + public Type[] PossibleTypes { get; set; } = new Type[0]; + public string Description { get; set; } = ""; + public string SerializedName { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class CompleterInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class DefaultInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Iso/IsoDate.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..861f943b24a7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Iso/IsoDate.cs @@ -0,0 +1,214 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal struct IsoDate + { + internal int Year { get; set; } // 0-3000 + + internal int Month { get; set; } // 1-12 + + internal int Day { get; set; } // 1-31 + + internal int Hour { get; set; } // 0-24 + + internal int Minute { get; set; } // 0-60 (60 is a special case) + + internal int Second { get; set; } // 0-60 (60 is used for leap seconds) + + internal double Millisecond { get; set; } // 0-999.9... + + internal TimeSpan Offset { get; set; } + + internal DateTimeKind Kind { get; set; } + + internal TimeSpan TimeOfDay => new TimeSpan(Hour, Minute, Second); + + internal DateTime ToDateTime() + { + if (Kind == DateTimeKind.Utc || Offset == TimeSpan.Zero) + { + return new DateTime(Year, Month, Day, Hour, Minute, Second, (int)Millisecond, DateTimeKind.Utc); + } + + return ToDateTimeOffset().DateTime; + } + + internal DateTimeOffset ToDateTimeOffset() + { + return new DateTimeOffset( + Year, + Month, + Day, + Hour, + Minute, + Second, + (int)Millisecond, + Offset + ); + } + + internal DateTime ToUtcDateTime() + { + return ToDateTimeOffset().UtcDateTime; + } + + public override string ToString() + { + var sb = new StringBuilder(); + + // yyyy-MM-dd + sb.Append($"{Year}-{Month:00}-{Day:00}"); + + if (TimeOfDay > new TimeSpan(0)) + { + sb.Append($"T{Hour:00}:{Minute:00}"); + + if (TimeOfDay.Seconds > 0) + { + sb.Append($":{Second:00}"); + } + } + + if (Offset.Ticks == 0) + { + sb.Append('Z'); // UTC + } + else + { + if (Offset.Ticks >= 0) + { + sb.Append('+'); + } + + sb.Append($"{Offset.Hours:00}:{Offset.Minutes:00}"); + } + + return sb.ToString(); + } + + internal static IsoDate FromDateTimeOffset(DateTimeOffset date) + { + return new IsoDate { + Year = date.Year, + Month = date.Month, + Day = date.Day, + Hour = date.Hour, + Minute = date.Minute, + Second = date.Second, + Offset = date.Offset, + Kind = date.Offset == TimeSpan.Zero ? DateTimeKind.Utc : DateTimeKind.Unspecified + }; + } + + private static readonly char[] timeSeperators = { ':', '.' }; + + internal static IsoDate Parse(string text) + { + var tzIndex = -1; + var timeIndex = text.IndexOf('T'); + + var builder = new IsoDate { Day = 1, Month = 1 }; + + // TODO: strip the time zone offset off the end + string dateTime = text; + string timeZone = null; + + if (dateTime.IndexOf('Z') > -1) + { + tzIndex = dateTime.LastIndexOf('Z'); + + builder.Kind = DateTimeKind.Utc; + } + else if (dateTime.LastIndexOf('+') > 10) + { + tzIndex = dateTime.LastIndexOf('+'); + } + else if (dateTime.LastIndexOf('-') > 10) + { + tzIndex = dateTime.LastIndexOf('-'); + } + + if (tzIndex > -1) + { + timeZone = dateTime.Substring(tzIndex); + dateTime = dateTime.Substring(0, tzIndex); + } + + string date = (timeIndex == -1) ? dateTime : dateTime.Substring(0, timeIndex); + + var dateParts = date.Split(Seperator.Dash); // '-' + + for (int i = 0; i < dateParts.Length; i++) + { + var part = dateParts[i]; + + switch (i) + { + case 0: builder.Year = int.Parse(part); break; + case 1: builder.Month = int.Parse(part); break; + case 2: builder.Day = int.Parse(part); break; + } + } + + if (timeIndex > -1) + { + string[] timeParts = dateTime.Substring(timeIndex + 1).Split(timeSeperators); + + for (int i = 0; i < timeParts.Length; i++) + { + var part = timeParts[i]; + + switch (i) + { + case 0: builder.Hour = int.Parse(part); break; + case 1: builder.Minute = int.Parse(part); break; + case 2: builder.Second = int.Parse(part); break; + case 3: builder.Millisecond = double.Parse("0." + part) * 1000; break; + } + } + } + + if (timeZone != null && timeZone != "Z") + { + var hours = int.Parse(timeZone.Substring(1, 2)); + var minutes = int.Parse(timeZone.Substring(4, 2)); + + if (timeZone[0] == '-') + { + hours = -hours; + minutes = -minutes; + } + + builder.Offset = new TimeSpan(hours, minutes, 0); + } + + return builder; + } + } + + /* + YYYY # eg 1997 + YYYY-MM # eg 1997-07 + YYYY-MM-DD # eg 1997-07-16 + YYYY-MM-DDThh:mmTZD # eg 1997-07-16T19:20+01:00 + YYYY-MM-DDThh:mm:ssTZD # eg 1997-07-16T19:20:30+01:00 + YYYY-MM-DDThh:mm:ss.sTZD # eg 1997-07-16T19:20:30.45+01:00 + + where: + + YYYY = four-digit year + MM = two-digit month (01=January, etc.) + DD = two-digit day of month (01 through 31) + hh = two digits of hour (00 through 23) (am/pm NOT allowed) + mm = two digits of minute (00 through 59) + ss = two digits of second (00 through 59) + s = one or more digits representing a decimal fraction of a second + TZD = time zone designator (Z or +hh:mm or -hh:mm) + */ +} diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/JsonType.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..5a924dea1209 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/JsonType.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal enum JsonType + { + Null = 0, + Object = 1, + Array = 2, + Binary = 3, + Boolean = 4, + Date = 5, + Number = 6, + String = 7 + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Method.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Method.cs new file mode 100644 index 000000000000..880b33940059 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Method.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + internal static class Method + { + internal static System.Net.Http.HttpMethod Get = System.Net.Http.HttpMethod.Get; + internal static System.Net.Http.HttpMethod Put = System.Net.Http.HttpMethod.Put; + internal static System.Net.Http.HttpMethod Head = System.Net.Http.HttpMethod.Head; + internal static System.Net.Http.HttpMethod Post = System.Net.Http.HttpMethod.Post; + internal static System.Net.Http.HttpMethod Delete = System.Net.Http.HttpMethod.Delete; + internal static System.Net.Http.HttpMethod Options = System.Net.Http.HttpMethod.Options; + internal static System.Net.Http.HttpMethod Trace = System.Net.Http.HttpMethod.Trace; + internal static System.Net.Http.HttpMethod Patch = new System.Net.Http.HttpMethod("PATCH"); + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Models/JsonMember.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..e3018cf77e3c --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Models/JsonMember.cs @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; +using System.Runtime.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + + + internal sealed class JsonMember + { + private readonly TypeDetails type; + + private readonly Func getter; + private readonly Action setter; + + internal JsonMember(PropertyInfo property, int defaultOrder) + { + getter = property.GetValue; + setter = property.SetValue; + + var dataMember = property.GetCustomAttribute(); + + Name = dataMember?.Name ?? property.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(property.PropertyType); + + CanRead = property.CanRead; + } + + internal JsonMember(FieldInfo field, int defaultOrder) + { + getter = field.GetValue; + setter = field.SetValue; + + var dataMember = field.GetCustomAttribute(); + + Name = dataMember?.Name ?? field.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(field.FieldType); + + CanRead = true; + } + + internal string Name { get; } + + internal int Order { get; } + + internal TypeDetails TypeDetails => type; + + internal Type Type => type.NonNullType; + + internal bool IsList => type.IsList; + + // Arrays, Sets, ... + internal Type ElementType => type.ElementType; + + internal IJsonConverter Converter => type.JsonConverter; + + internal bool EmitDefaultValue { get; } + + internal bool IsStringLike => type.IsStringLike; + + internal object DefaultValue => type.DefaultValue; + + internal bool CanRead { get; } + + #region Helpers + + internal object GetValue(object instance) => getter(instance); + + internal void SetValue(object instance, object value) => setter(instance, value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Models/JsonModel.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..df361c4422be --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Models/JsonModel.cs @@ -0,0 +1,89 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal class JsonModel + { + private Dictionary map; + private readonly object _sync = new object(); + + private JsonModel(Type type, List members) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + Members = members ?? throw new ArgumentNullException(nameof(members)); + } + + internal string Name => Type.Name; + + internal Type Type { get; } + + internal List Members { get; } + + internal JsonMember this[string name] + { + get + { + if (map == null) + { + lock (_sync) + { + if (map == null) + { + map = new Dictionary(); + + foreach (JsonMember m in Members) + { + map[m.Name.ToLower()] = m; + } + } + } + } + + + map.TryGetValue(name.ToLower(), out JsonMember member); + + return member; + } + } + + internal static JsonModel FromType(Type type) + { + var members = new List(); + + int i = 0; + + // BindingFlags.Instance | BindingFlags.Public + + foreach (var member in type.GetFields()) + { + if (member.IsStatic) continue; + + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + foreach (var member in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + members.Sort((a, b) => a.Order.CompareTo(b.Order)); // inline sort + + return new JsonModel(type, members); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Models/JsonModelCache.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..37cdf0031c35 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Models/JsonModelCache.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Runtime.CompilerServices; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal static class JsonModelCache + { + private static readonly ConditionalWeakTable cache + = new ConditionalWeakTable(); + + internal static JsonModel Get(Type type) => cache.GetValue(type, Create); + + private static JsonModel Create(Type type) => JsonModel.FromType(type); + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..8a8040df105f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/JsonArray.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public abstract partial class JsonArray : JsonNode, IEnumerable + { + internal override JsonType Type => JsonType.Array; + + internal abstract JsonType? ElementType { get; } + + public abstract int Count { get; } + + internal virtual bool IsSet => false; + + internal bool IsEmpty => Count == 0; + + #region IEnumerable + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + + #region Static Helpers + + internal static JsonArray Create(short[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(int[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(long[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(decimal[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(float[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(string[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(XBinary[] values) + => new XImmutableArray(values); + + #endregion + + internal static new JsonArray Parse(string text) + => (JsonArray)JsonNode.Parse(text); + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..048ae9e66314 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XImmutableArray.cs @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal sealed class XImmutableArray : JsonArray, IEnumerable + { + private readonly T[] values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XImmutableArray(T[] values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Length; + + public bool IsReadOnly => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + #region Static Constructor + + internal XImmutableArray Create(T[] items) + { + return new XImmutableArray(items); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..9689878f5e32 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XList.cs @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal sealed class XList : JsonArray, IEnumerable + { + private readonly IList values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XList(IList values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Count; + + public bool IsReadOnly => values.IsReadOnly; + + #region IList + + public void Add(T value) + { + values.Add(value); + } + + public bool Contains(T value) => values.Contains(value); + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..fad2df12e9df --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed partial class XNodeArray : JsonArray, ICollection + { + private readonly List items; + + internal XNodeArray() + { + items = new List(); + } + + internal XNodeArray(params JsonNode[] values) + { + items = new List(values); + } + + public override JsonNode this[int index] => items[index]; + + internal override JsonType? ElementType => null; + + public bool IsReadOnly => false; + + public override int Count => items.Count; + + #region ICollection Members + + public void Add(JsonNode item) + { + items.Add(item); + } + + void ICollection.Clear() + { + items.Clear(); + } + + public bool Contains(JsonNode item) => items.Contains(item); + + void ICollection.CopyTo(JsonNode[] array, int arrayIndex) + { + items.CopyTo(array, arrayIndex); + } + + public bool Remove(JsonNode item) + { + return items.Remove(item); + } + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..932f166a88df --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/Collections/XSet.cs @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal sealed class XSet : JsonArray, IEnumerable + { + private readonly HashSet values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XSet(IEnumerable values) + : this(new HashSet(values)) + { } + + internal XSet(HashSet values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + internal override JsonType Type => JsonType.Array; + + internal override JsonType? ElementType => elementType; + + public bool IsReadOnly => true; + + public override int Count => values.Count; + + internal override bool IsSet => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + internal HashSet AsHashSet() => values; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..aae7d73603d4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonBoolean.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal sealed partial class JsonBoolean : JsonNode + { + internal static readonly JsonBoolean True = new JsonBoolean(true); + internal static readonly JsonBoolean False = new JsonBoolean(false); + + internal JsonBoolean(bool value) + { + Value = value; + } + + internal bool Value { get; } + + internal override JsonType Type => JsonType.Boolean; + + internal static new JsonBoolean Parse(string text) + { + switch (text) + { + case "false": return False; + case "true": return True; + + default: throw new ArgumentException($"Expected true or false. Was {text}."); + } + } + + #region Implicit Casts + + public static implicit operator bool(JsonBoolean data) => data.Value; + + public static implicit operator JsonBoolean(bool data) => new JsonBoolean(data); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonDate.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..360c0f893afc --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonDate.cs @@ -0,0 +1,173 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + + + internal sealed partial class JsonDate : JsonNode, IEquatable, IComparable + { + internal static bool AssumeUtcWhenKindIsUnspecified = true; + + private readonly DateTimeOffset value; + + internal JsonDate(DateTime value) + { + if (value.Kind == DateTimeKind.Unspecified && AssumeUtcWhenKindIsUnspecified) + { + value = DateTime.SpecifyKind(value, DateTimeKind.Utc); + } + + this.value = value; + } + + internal JsonDate(DateTimeOffset value) + { + this.value = value; + } + + internal override JsonType Type => JsonType.Date; + + #region Helpers + + internal DateTimeOffset ToDateTimeOffset() + { + return value; + } + + internal DateTime ToDateTime() + { + if (value.Offset == TimeSpan.Zero) + { + return value.UtcDateTime; + } + + return value.DateTime; + } + + internal DateTime ToUtcDateTime() => value.UtcDateTime; + + internal int ToUnixTimeSeconds() + { + return (int)value.ToUnixTimeSeconds(); + } + + internal long ToUnixTimeMilliseconds() + { + return (int)value.ToUnixTimeMilliseconds(); + } + + internal string ToIsoString() + { + return IsoDate.FromDateTimeOffset(value).ToString(); + } + + #endregion + + public override string ToString() + { + return ToIsoString(); + } + + internal static new JsonDate Parse(string text) + { + if (text == null) throw new ArgumentNullException(nameof(text)); + + // TODO support: unixtimeseconds.partialseconds + + if (text.Length > 4 && _IsNumber(text)) // UnixTime + { + var date = DateTimeOffset.FromUnixTimeSeconds(long.Parse(text)); + + return new JsonDate(date); + } + else if (text.Length <= 4 || text[4] == '-') // ISO: 2012- + { + return new JsonDate(IsoDate.Parse(text).ToDateTimeOffset()); + } + else + { + // NOT ISO ENCODED + // "Thu, 5 Apr 2012 16:59:01 +0200", + return new JsonDate(DateTimeOffset.Parse(text)); + } + } + + private static bool _IsNumber(string text) + { + foreach (var c in text) + { + if (!char.IsDigit(c)) return false; + } + + return true; + } + + internal static JsonDate FromUnixTime(int seconds) + { + return new JsonDate(DateTimeOffset.FromUnixTimeSeconds(seconds)); + } + + internal static JsonDate FromUnixTime(double seconds) + { + var milliseconds = (long)(seconds * 1000d); + + return new JsonDate(DateTimeOffset.FromUnixTimeMilliseconds(milliseconds)); + } + + #region Implicit Casts + + public static implicit operator DateTimeOffset(JsonDate value) + => value.ToDateTimeOffset(); + + public static implicit operator DateTime(JsonDate value) + => value.ToDateTime(); + + // From Date + public static implicit operator JsonDate(DateTimeOffset value) + { + return new JsonDate(value); + } + + public static implicit operator JsonDate(DateTime value) + { + return new JsonDate(value); + } + + // From String + public static implicit operator JsonDate(string value) + { + return Parse(value); + } + + #endregion + + #region Equality + + public override bool Equals(object obj) + { + return obj is JsonDate date && date.value == this.value; + } + + public bool Equals(JsonDate other) + { + return this.value == other.value; + } + + public override int GetHashCode() => value.GetHashCode(); + + #endregion + + #region IComparable Members + + int IComparable.CompareTo(JsonDate other) + { + return value.CompareTo(other.value); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonNode.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..268ce29e09c0 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonNode.cs @@ -0,0 +1,250 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + + + public abstract partial class JsonNode + { + internal abstract JsonType Type { get; } + + public virtual JsonNode this[int index] => throw new NotImplementedException(); + + public virtual JsonNode this[string name] + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #region Type Helpers + + internal bool IsArray => Type == JsonType.Array; + + internal bool IsDate => Type == JsonType.Date; + + internal bool IsObject => Type == JsonType.Object; + + internal bool IsNumber => Type == JsonType.Number; + + internal bool IsNull => Type == JsonType.Null; + + #endregion + + internal void WriteTo(TextWriter textWriter, bool pretty = true) + { + var writer = new JsonWriter(textWriter, pretty); + + writer.WriteNode(this); + } + + internal T As() + where T : new() + => new JsonSerializer().Deseralize((JsonObject)this); + + internal T[] ToArrayOf() + { + return (T[])new JsonSerializer().DeserializeArray(typeof(T[]), (JsonArray)this); + } + + #region ToString Overrides + + public override string ToString() => ToString(pretty: true); + + internal string ToString(bool pretty) + { + var sb = new StringBuilder(); + + using (var writer = new StringWriter(sb)) + { + WriteTo(writer, pretty); + + return sb.ToString(); + } + } + + #endregion + + #region Static Constructors + + internal static JsonNode Parse(string text) + { + return Parse(new SourceReader(new StringReader(text))); + } + + internal static JsonNode Parse(TextReader textReader) + => Parse(new SourceReader(textReader)); + + private static JsonNode Parse(SourceReader sourceReader) + { + using (var parser = new JsonParser(sourceReader)) + { + return parser.ReadNode(); + } + } + + internal static JsonNode FromObject(object instance) + => new JsonSerializer().Serialize(instance); + + #endregion + + #region Implict Casts + + public static implicit operator string(JsonNode node) => node.ToString(); + + #endregion + + #region Explict Casts + + public static explicit operator DateTime(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date: + return ((JsonDate)node).ToDateTime(); + + case JsonType.String: + return JsonDate.Parse(node.ToString()).ToDateTime(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num).UtcDateTime; + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)).UtcDateTime; + } + } + + throw new ConversionException(node, typeof(DateTime)); + } + + public static explicit operator DateTimeOffset(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date : return ((JsonDate)node).ToDateTimeOffset(); + case JsonType.String : return JsonDate.Parse(node.ToString()).ToDateTimeOffset(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num); + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)); + } + + } + + throw new ConversionException(node, typeof(DateTimeOffset)); + } + + public static explicit operator float(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return float.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(float)); + } + + public static explicit operator double(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return double.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(double)); + } + + public static explicit operator decimal(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return decimal.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(decimal)); + } + + public static explicit operator Guid(JsonNode node) + => new Guid(node.ToString()); + + public static explicit operator short(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return short.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(short)); + } + + public static explicit operator int(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return int.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(int)); + } + + public static explicit operator long(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return long.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(long)); + } + + public static explicit operator bool(JsonNode node) + => ((JsonBoolean)node).Value; + + public static explicit operator ushort(JsonNode node) + => (JsonNumber)node; + + public static explicit operator uint(JsonNode node) + => (JsonNumber)node; + + public static explicit operator ulong(JsonNode node) + => (JsonNumber)node; + + public static explicit operator TimeSpan(JsonNode node) + => TimeSpan.Parse(node.ToString()); + + public static explicit operator Uri(JsonNode node) + { + if (node.Type == JsonType.String) + { + return new Uri(node.ToString()); + } + + throw new ConversionException(node, typeof(Uri)); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..2b3157b938eb --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonNumber.cs @@ -0,0 +1,109 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed partial class JsonNumber : JsonNode + { + private readonly string value; + private readonly bool overflows = false; + + internal JsonNumber(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal JsonNumber(int value) + { + this.value = value.ToString(); + } + + internal JsonNumber(long value) + { + this.value = value.ToString(); + + if (value > 9007199254740991) + { + overflows = true; + } + } + + internal JsonNumber(float value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal JsonNumber(double value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal override JsonType Type => JsonType.Number; + + internal string Value => value; + + #region Helpers + + internal bool Overflows => overflows; + + internal bool IsInteger => !value.Contains("."); + + internal bool IsFloat => value.Contains("."); + + #endregion + + #region Casting + + public static implicit operator byte(JsonNumber number) + => byte.Parse(number.Value); + + public static implicit operator short(JsonNumber number) + => short.Parse(number.Value); + + public static implicit operator int(JsonNumber number) + => int.Parse(number.Value); + + public static implicit operator long(JsonNumber number) + => long.Parse(number.value); + + public static implicit operator UInt16(JsonNumber number) + => ushort.Parse(number.Value); + + public static implicit operator UInt32(JsonNumber number) + => uint.Parse(number.Value); + + public static implicit operator UInt64(JsonNumber number) + => ulong.Parse(number.Value); + + public static implicit operator decimal(JsonNumber number) + => decimal.Parse(number.Value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator Double(JsonNumber number) + => double.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator float(JsonNumber number) + => float.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator JsonNumber(short data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(int data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(long data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(Single data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(double data) + => new JsonNumber(data.ToString()); + + #endregion + + public override string ToString() => value; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonObject.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..ec1d7efeaded --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonObject.cs @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public partial class JsonObject : JsonNode, IDictionary + { + private readonly Dictionary items; + + internal JsonObject() + { + items = new Dictionary(); + } + + internal JsonObject(IEnumerable> properties) + { + if (properties == null) throw new ArgumentNullException(nameof(properties)); + + items = new Dictionary(); + + foreach (var field in properties) + { + items.Add(field.Key, field.Value); + } + } + + #region IDictionary Constructors + + internal JsonObject(IDictionary dic) + { + items = new Dictionary(dic.Count); + + foreach (var pair in dic) + { + Add(pair.Key, pair.Value); + } + } + + #endregion + + internal override JsonType Type => JsonType.Object; + + #region Add Overloads + + public void Add(string name, JsonNode value) => + items.Add(name, value); + + public void Add(string name, byte[] value) => + items.Add(name, new XBinary(value)); + + public void Add(string name, DateTime value) => + items.Add(name, new JsonDate(value)); + + public void Add(string name, int value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, long value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, float value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, double value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, string value) => + items.Add(name, new JsonString(value)); + + public void Add(string name, bool value) => + items.Add(name, new JsonBoolean(value)); + + public void Add(string name, Uri url) => + items.Add(name, new JsonString(url.AbsoluteUri)); + + public void Add(string name, string[] values) => + items.Add(name, new XImmutableArray(values)); + + public void Add(string name, int[] values) => + items.Add(name, new XImmutableArray(values)); + + #endregion + + #region ICollection> Members + + void ICollection>.Add(KeyValuePair item) + { + items.Add(item.Key, item.Value); + } + + void ICollection>.Clear() + { + items.Clear(); + } + + bool ICollection>.Contains(KeyValuePair item) => + throw new NotImplementedException(); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) => + throw new NotImplementedException(); + + + int ICollection>.Count => items.Count; + + bool ICollection>.IsReadOnly => false; + + bool ICollection>.Remove(KeyValuePair item) => + throw new NotImplementedException(); + + #endregion + + #region IDictionary Members + + public bool ContainsKey(string key) => items.ContainsKey(key); + + public ICollection Keys => items.Keys; + + public bool Remove(string key) => items.Remove(key); + + public bool TryGetValue(string key, out JsonNode value) => + items.TryGetValue(key, out value); + + public ICollection Values => items.Values; + + public override JsonNode this[string key] + { + get => items[key]; + set => items[key] = value; + } + + #endregion + + #region IEnumerable + + IEnumerator> IEnumerable>.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + + #region Helpers + + internal static new JsonObject FromObject(object instance) => + (JsonObject)new JsonSerializer().Serialize(instance); + + #endregion + + #region Static Constructors + + internal static JsonObject FromStream(Stream stream) + { + using (var tr = new StreamReader(stream)) + { + return (JsonObject)Parse(tr); + } + } + + internal static new JsonObject Parse(string text) + { + return (JsonObject)JsonNode.Parse(text); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonString.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..aa6efbc6c147 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/JsonString.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed partial class JsonString : JsonNode, IEquatable + { + private readonly string value; + + internal JsonString(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal override JsonType Type => JsonType.String; + + internal string Value => value; + + internal int Length => value.Length; + + #region #region Implicit Casts + + public static implicit operator string(JsonString data) => data.Value; + + public static implicit operator JsonString(string value) => new JsonString(value); + + #endregion + + public override int GetHashCode() => value.GetHashCode(); + + public override string ToString() => value; + + #region IEquatable + + bool IEquatable.Equals(JsonString other) => this.Value == other.Value; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/XBinary.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..9fd0587b0b18 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/XBinary.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal sealed class XBinary : JsonNode + { + private readonly byte[] _value; + private readonly string _base64; + + internal XBinary(byte[] value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal XBinary(string base64EncodedString) + { + _base64 = base64EncodedString ?? throw new ArgumentNullException(nameof(base64EncodedString)); + } + + internal override JsonType Type => JsonType.Binary; + + internal byte[] Value => _value ?? Convert.FromBase64String(_base64); + + #region #region Implicit Casts + + public static implicit operator byte[] (XBinary data) => data.Value; + + public static implicit operator XBinary(byte[] data) => new XBinary(data); + + #endregion + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => _base64 ?? Convert.ToBase64String(_value); + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/XNull.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..a6c133fc9450 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Nodes/XNull.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal sealed class XNull : JsonNode + { + internal static readonly XNull Instance = new XNull(); + + private XNull() { } + + internal override JsonType Type => JsonType.Null; + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..907055a92d85 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/Exceptions/ParseException.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal class ParserException : Exception + { + internal ParserException(string message) + : base(message) + { } + + internal ParserException(string message, SourceLocation location) + : base(message) + { + + Location = location; + } + + internal SourceLocation Location { get; } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/JsonParser.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..eae774b46af7 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/JsonParser.cs @@ -0,0 +1,180 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public class JsonParser : IDisposable + { + private readonly TokenReader reader; + + internal JsonParser(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonParser(SourceReader sourceReader) + { + if (sourceReader == null) + throw new ArgumentNullException(nameof(sourceReader)); + + this.reader = new TokenReader(new JsonTokenizer(sourceReader)); + + this.reader.Next(); // Start with the first token + } + + internal IEnumerable ReadNodes() + { + JsonNode node; + + while ((node = ReadNode()) != null) yield return node; + } + + internal JsonNode ReadNode() + { + if (reader.Current.Kind == TokenKind.Eof || reader.Current.IsTerminator) + { + return null; + } + + switch (reader.Current.Kind) + { + case TokenKind.LeftBrace : return ReadObject(); // { + case TokenKind.LeftBracket : return ReadArray(); // [ + + default: throw new ParserException($"Expected '{{' or '['. Was {reader.Current}."); + } + } + + private JsonNode ReadFieldValue() + { + // Boolean, Date, Null, Number, String, Uri + if (reader.Current.IsLiteral) + { + return ReadLiteral(); + } + else + { + switch (reader.Current.Kind) + { + case TokenKind.LeftBracket: return ReadArray(); + case TokenKind.LeftBrace : return ReadObject(); + + default: throw new ParserException($"Unexpected token reading field value. Was {reader.Current}."); + } + } + } + + private JsonNode ReadLiteral() + { + var literal = reader.Current; + + reader.Next(); // Read the literal token + + switch (literal.Kind) + { + case TokenKind.Boolean : return JsonBoolean.Parse(literal.Value); + case TokenKind.Null : return XNull.Instance; + case TokenKind.Number : return new JsonNumber(literal.Value); + case TokenKind.String : return new JsonString(literal.Value); + + default: throw new ParserException($"Unexpected token reading literal. Was {literal}."); + } + } + + internal JsonObject ReadObject() + { + reader.Ensure(TokenKind.LeftBrace, "object"); + + reader.Next(); // Read '{' (Object start) + + var jsonObject = new JsonObject(); + + // Read the object's fields until we reach the end of the object ('}') + while (reader.Current.Kind != TokenKind.RightBrace) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read ',' (Seperator) + } + + // Ensure we have a field name + reader.Ensure(TokenKind.String, "Expected field name"); + + var field = ReadField(); + + jsonObject.Add(field.Key, field.Value); + } + + reader.Next(); // Read '}' (Object end) + + return jsonObject; + } + + + // TODO: Use ValueTuple in C#7 + private KeyValuePair ReadField() + { + var fieldName = reader.Current.Value; + + reader.Next(); // Read the field name + + reader.Ensure(TokenKind.Colon, "field"); + + reader.Next(); // Read ':' (Field value indicator) + + return new KeyValuePair(fieldName, ReadFieldValue()); + } + + + internal JsonArray ReadArray() + { + reader.Ensure(TokenKind.LeftBracket, "array"); + + var array = new XNodeArray(); + + reader.Next(); // Read the '[' (Array start) + + // Read the array's items + while (reader.Current.Kind != TokenKind.RightBracket) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read the ',' (Seperator) + } + + if (reader.Current.IsLiteral) + { + array.Add(ReadLiteral()); // Boolean, Date, Number, Null, String, Uri + } + else if (reader.Current.Kind == TokenKind.LeftBracket) + { + array.Add(ReadArray()); // Array + } + else if (reader.Current.Kind == TokenKind.LeftBrace) + { + array.Add(ReadObject()); // Object + } + else + { + throw new ParserException($"Expected comma, literal, or object. Was {reader.Current}."); + } + } + + reader.Next(); // Read the ']' (Array end) + + return array; + } + + #region IDisposable + + public void Dispose() + { + reader.Dispose(); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/JsonToken.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..a07a775aab84 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/JsonToken.cs @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal enum TokenKind + { + LeftBrace, // { Object start + RightBrace, // } Object end + + LeftBracket, // [ Array start + RightBracket, // ] Array end + + Comma, // , Comma + Colon, // : Value indicator + Dot, // . Access field indicator + Terminator, // \0 Stream terminator + + Boolean = 31, // true or false + Null = 33, // null + Number = 34, // i.e. -1.93, -1, 0, 1, 1.1 + String = 35, // i.e. "text" + + Eof = 50 + } + + internal /* readonly */ struct JsonToken + { + internal static readonly JsonToken BraceOpen = new JsonToken(TokenKind.LeftBrace, "{"); + internal static readonly JsonToken BraceClose = new JsonToken(TokenKind.RightBrace, "}"); + + internal static readonly JsonToken BracketOpen = new JsonToken(TokenKind.LeftBracket, "["); + internal static readonly JsonToken BracketClose = new JsonToken(TokenKind.RightBracket, "]"); + + internal static readonly JsonToken Colon = new JsonToken(TokenKind.Colon, ":"); + internal static readonly JsonToken Comma = new JsonToken(TokenKind.Comma, ","); + internal static readonly JsonToken Terminator = new JsonToken(TokenKind.Terminator, "\0"); + + internal static readonly JsonToken True = new JsonToken(TokenKind.Boolean, "true"); + internal static readonly JsonToken False = new JsonToken(TokenKind.Boolean, "false"); + internal static readonly JsonToken Null = new JsonToken(TokenKind.Null, "null"); + + internal static readonly JsonToken Eof = new JsonToken(TokenKind.Eof, null); + + internal JsonToken(TokenKind kind, string value) + { + Kind = kind; + Value = value; + } + + internal readonly TokenKind Kind; + + internal readonly string Value; + + public override string ToString() => Kind + ": " + Value; + + #region Helpers + + internal bool IsLiteral => (byte)Kind > 30 && (byte)Kind < 40; + + internal bool IsTerminator => Kind == TokenKind.Terminator; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..6663e10d11e8 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/JsonTokenizer.cs @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + using System.IO; + + + public class JsonTokenizer : IDisposable + { + private readonly StringBuilder sb = new StringBuilder(); + + private readonly SourceReader reader; + + internal JsonTokenizer(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonTokenizer(SourceReader reader) + { + this.reader = reader; + + reader.Next(); // Start with the first char + } + + internal JsonToken ReadNext() + { + reader.SkipWhitespace(); + + if (reader.IsEof) return JsonToken.Eof; + + switch (reader.Current) + { + case '"': return ReadQuotedString(); + + // Symbols + case '[' : reader.Next(); return JsonToken.BracketOpen; // Array start + case ']' : reader.Next(); return JsonToken.BracketClose; // Array end + case ',' : reader.Next(); return JsonToken.Comma; // Value seperator + case ':' : reader.Next(); return JsonToken.Colon; // Field value indicator + case '{' : reader.Next(); return JsonToken.BraceOpen; // Object start + case '}' : reader.Next(); return JsonToken.BraceClose; // Object end + case '\0' : reader.Next(); return JsonToken.Terminator; // Stream terminiator + + default: return ReadLiteral(); + } + } + + private JsonToken ReadQuotedString() + { + Expect('"', "quoted string indicator"); + + reader.Next(); // Read '"' (Starting quote) + + // Read until we reach an unescaped quote char + while (reader.Current != '"') + { + EnsureNotEof("quoted string"); + + if (reader.Current == '\\') + { + char escapedCharacter = reader.ReadEscapeCode(); + + sb.Append(escapedCharacter); + + continue; + } + + StoreCurrentCharacterAndReadNext(); + } + + reader.Next(); // Read '"' (Ending quote) + + return new JsonToken(TokenKind.String, value: sb.Extract()); + } + + private JsonToken ReadLiteral() + { + if (char.IsDigit(reader.Current) || + reader.Current == '-' || + reader.Current == '+') + { + return ReadNumber(); + } + + return ReadIdentifer(); + } + + private JsonToken ReadNumber() + { + // Read until we hit a non-numeric character + // -6.247737e-06 + // E + + while (char.IsDigit(reader.Current) + || reader.Current == '.' + || reader.Current == 'e' + || reader.Current == 'E' + || reader.Current == '-' + || reader.Current == '+') + { + StoreCurrentCharacterAndReadNext(); + } + + return new JsonToken(TokenKind.Number, value: sb.Extract()); + } + + int count = 0; + + private JsonToken ReadIdentifer() + { + count++; + + if (!char.IsLetter(reader.Current)) + { + throw new ParserException( + message : $"Expected literal (number, boolean, or null). Was '{reader.Current}'.", + location : reader.Location + ); + } + + // Read letters, numbers, and underscores '_' + while (char.IsLetterOrDigit(reader.Current) || reader.Current == '_') + { + StoreCurrentCharacterAndReadNext(); + } + + string text = sb.Extract(); + + switch (text) + { + case "true": return JsonToken.True; + case "false": return JsonToken.False; + case "null": return JsonToken.Null; + + default: return new JsonToken(TokenKind.String, text); + } + } + + private void Expect(char character, string description) + { + if (reader.Current != character) + { + throw new ParserException( + message: $"Expected {description} ('{character}'). Was '{reader.Current}'.", + location: reader.Location + ); + } + } + + private void EnsureNotEof(string tokenType) + { + if (reader.IsEof) + { + throw new ParserException( + message: $"Unexpected EOF while reading {tokenType}.", + location: reader.Location + ); + } + } + + private void StoreCurrentCharacterAndReadNext() + { + sb.Append(reader.Current); + + reader.Next(); + } + + public void Dispose() + { + reader.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/Location.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..965a7ce7fa23 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/Location.cs @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal struct SourceLocation + { + private int line; + private int column; + private int position; + + internal SourceLocation(int line = 0, int column = 0, int position = 0) + { + this.line = line; + this.column = column; + this.position = position; + } + + internal int Line => line; + + internal int Column => column; + + internal int Position => position; + + internal void Advance() + { + this.column++; + this.position++; + } + + internal void MarkNewLine() + { + this.line++; + this.column = 0; + } + + internal SourceLocation Clone() + { + return new SourceLocation(line, column, position); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..2a41cd6923f3 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/Readers/SourceReader.cs @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Globalization; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public sealed class SourceReader : IDisposable + { + private readonly TextReader source; + + private char current; + + private readonly SourceLocation location = new SourceLocation(); + + private bool isEof = false; + + internal SourceReader(TextReader textReader) + { + this.source = textReader ?? throw new ArgumentNullException(nameof(textReader)); + } + + /// + /// Advances to the next character + /// + internal void Next() + { + // Advance to the new line when we see a new line '\n'. + // A new line may be prefixed by a carriage return '\r'. + + if (current == '\n') + { + location.MarkNewLine(); + } + + int charCode = source.Read(); // -1 for end + + if (charCode >= 0) + { + current = (char)charCode; + } + else + { + // If we've already marked this as the EOF, throw an exception + if (isEof) + { + throw new EndOfStreamException("Cannot advance past end of stream."); + } + + isEof = true; + + current = '\0'; + } + + location.Advance(); + } + + internal void SkipWhitespace() + { + while (char.IsWhiteSpace(current)) + { + Next(); + } + } + + internal char ReadEscapeCode() + { + Next(); + + char escapedChar = current; + + Next(); // Consume escaped character + + switch (escapedChar) + { + // Special escape codes + case '"': return '"'; // " (Quotation mark) U+0022 + case '/': return '/'; // / (Solidus) U+002F + case '\\': return '\\'; // \ (Reverse solidus) U+005C + + // Control Characters + case '0': return '\0'; // Nul (0) U+0000 + case 'a': return '\a'; // Alert (7) + case 'b': return '\b'; // Backspace (8) U+0008 + case 'f': return '\f'; // Form feed (12) U+000C + case 'n': return '\n'; // Line feed (10) U+000A + case 'r': return '\r'; // Carriage return (13) U+000D + case 't': return '\t'; // Horizontal tab (9) U+0009 + case 'v': return '\v'; // Vertical tab + + // Unicode escape sequence + case 'u': return ReadUnicodeEscapeSequence(); // U+XXXX + + default: throw new Exception($"Unrecognized escape sequence '\\{escapedChar}'"); + } + } + + private readonly char[] hexCode = new char[4]; + + private char ReadUnicodeEscapeSequence() + { + hexCode[0] = current; Next(); + hexCode[1] = current; Next(); + hexCode[2] = current; Next(); + hexCode[3] = current; Next(); + + return Convert.ToChar(int.Parse( + s : new string(hexCode), + style : NumberStyles.HexNumber, + provider: NumberFormatInfo.InvariantInfo + )); + } + + internal char Current => current; + + internal bool IsEof => isEof; + + internal char Peek() => (char)source.Peek(); + + internal SourceLocation Location => location; + + public void Dispose() + { + source.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/TokenReader.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..d7531fac7803 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Parser/TokenReader.cs @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + public class TokenReader : IDisposable + { + private readonly JsonTokenizer tokenizer; + private JsonToken current; + + internal TokenReader(JsonTokenizer tokenizer) + { + this.tokenizer = tokenizer ?? throw new ArgumentNullException(nameof(tokenizer)); + } + + internal void Next() + { + current = tokenizer.ReadNext(); + } + + internal JsonToken Current => current; + + internal void Ensure(TokenKind kind, string readerName) + { + if (current.Kind != kind) + { + throw new ParserException($"Expected {kind} while reading {readerName}). Was {current}."); + } + } + + public void Dispose() + { + tokenizer.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/PipelineMocking.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..bc1624dcb52d --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/PipelineMocking.cs @@ -0,0 +1,262 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + using System.Threading.Tasks; + using System.Collections.Generic; + using System.Net.Http; + using System.Linq; + using System.Net; + using Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json; + + public enum MockMode + { + Live, + Record, + Playback, + + } + + public class PipelineMock + { + + private System.Collections.Generic.Stack scenario = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack context = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack description = new System.Collections.Generic.Stack(); + + private readonly string recordingPath; + private int counter = 0; + + public static implicit operator Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SendAsyncStep(PipelineMock instance) => instance.SendAsync; + + public MockMode Mode { get; set; } = MockMode.Live; + public PipelineMock(string recordingPath) + { + this.recordingPath = recordingPath; + } + + public void PushContext(string text) => context.Push(text); + + public void PushDescription(string text) => description.Push(text); + + + public void PushScenario(string it) + { + // reset counter too + counter = 0; + + scenario.Push(it); + } + + public void PopContext() => context.Pop(); + + public void PopDescription() => description.Pop(); + + public void PopScenario() => scenario.Pop(); + + public void SetRecord() => Mode = MockMode.Record; + + public void SetPlayback() => Mode = MockMode.Playback; + + public void SetLive() => Mode = MockMode.Live; + + public string Scenario => (scenario.Count > 0 ? scenario.Peek() : "[NoScenario]"); + public string Description => (description.Count > 0 ? description.Peek() : "[NoDescription]"); + public string Context => (context.Count > 0 ? context.Peek() : "[NoContext]"); + + /// + /// Headers that we substitute out blank values for in the recordings + /// Add additional headers as necessary + /// + public static HashSet Blacklist = new HashSet(System.StringComparer.CurrentCultureIgnoreCase) { + "Authorization", + }; + + public Dictionary ForceResponseHeaders = new Dictionary(); + + internal static XImmutableArray Removed = new XImmutableArray(new string[] { "[Filtered]" }); + + internal static IEnumerable> FilterHeaders(IEnumerable>> headers) => headers.Select(header => new KeyValuePair(header.Key, Blacklist.Contains(header.Key) ? Removed : new XImmutableArray(header.Value.ToArray()))); + + internal static JsonNode SerializeContent(HttpContent content, ref bool isBase64) => content == null ? XNull.Instance : SerializeContent(content.ReadAsByteArrayAsync().Result, ref isBase64); + + internal static JsonNode SerializeContent(byte[] content, ref bool isBase64) + { + if (null == content || content.Length == 0) + { + return XNull.Instance; + } + var first = content[0]; + var last = content[content.Length - 1]; + + // plaintext for JSON/SGML/XML/HTML/STRINGS/ARRAYS + if ((first == '{' && last == '}') || (first == '<' && last == '>') || (first == '[' && last == ']') || (first == '"' && last == '"')) + { + return new JsonString(System.Text.Encoding.UTF8.GetString(content)); + } + + // base64 for everyone else + return new JsonString(System.Convert.ToBase64String(content)); + } + + internal static byte[] DeserializeContent(string content, bool isBase64) + { + if (string.IsNullOrWhiteSpace(content)) + { + return new byte[0]; + } + + if (isBase64) + { + try + { + return System.Convert.FromBase64String(content); + } + catch + { + // hmm. didn't work, return it as a string I guess. + } + } + return System.Text.Encoding.UTF8.GetBytes(content); + } + + public void SaveMessage(string rqKey, HttpRequestMessage request, HttpResponseMessage response) + { + var messages = System.IO.File.Exists(this.recordingPath) ? Load() : new JsonObject() ?? new JsonObject(); + bool isBase64Request = false; + bool isBase64Response = false; + messages[rqKey] = new JsonObject { + { "Request",new JsonObject { + { "Method", request.Method.Method }, + { "RequestUri", request.RequestUri }, + { "Content", SerializeContent( request.Content, ref isBase64Request) }, + { "isContentBase64", isBase64Request }, + { "Headers", new JsonObject(FilterHeaders(request.Headers)) }, + { "ContentHeaders", request.Content == null ? new JsonObject() : new JsonObject(FilterHeaders(request.Content.Headers))} + } }, + {"Response", new JsonObject { + { "StatusCode", (int)response.StatusCode}, + { "Headers", new JsonObject(FilterHeaders(response.Headers))}, + { "ContentHeaders", new JsonObject(FilterHeaders(response.Content.Headers))}, + { "Content", SerializeContent(response.Content, ref isBase64Response) }, + { "isContentBase64", isBase64Response }, + }} + }; + System.IO.File.WriteAllText(this.recordingPath, messages.ToString()); + } + + private JsonObject Load() + { + if (System.IO.File.Exists(this.recordingPath)) + { + try + { + return JsonObject.FromStream(System.IO.File.OpenRead(this.recordingPath)); + } + catch + { + throw new System.Exception($"Invalid recording file: '{recordingPath}'"); + } + } + + throw new System.ArgumentException($"Missing recording file: '{recordingPath}'", nameof(recordingPath)); + } + + public HttpResponseMessage LoadMessage(string rqKey) + { + var responses = Load(); + var message = responses.Property(rqKey); + + if (null == message) + { + throw new System.ArgumentException($"Missing Request '{rqKey}' in recording file", nameof(rqKey)); + } + + var sc = 0; + var reqMessage = message.Property("Request"); + var respMessage = message.Property("Response"); + + // --------------------------- deserialize response ---------------------------------------------------------------- + bool isBase64Response = false; + respMessage.BooleanProperty("isContentBase64", ref isBase64Response); + var response = new HttpResponseMessage + { + StatusCode = (HttpStatusCode)respMessage.NumberProperty("StatusCode", ref sc), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(respMessage.StringProperty("Content"), isBase64Response)) + }; + + foreach (var each in respMessage.Property("Headers")) + { + response.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + foreach (var frh in ForceResponseHeaders) + { + response.Headers.Remove(frh.Key); + response.Headers.TryAddWithoutValidation(frh.Key, frh.Value); + } + + foreach (var each in respMessage.Property("ContentHeaders")) + { + response.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + // --------------------------- deserialize request ---------------------------------------------------------------- + bool isBase64Request = false; + reqMessage.BooleanProperty("isContentBase64", ref isBase64Request); + response.RequestMessage = new HttpRequestMessage + { + Method = new HttpMethod(reqMessage.StringProperty("Method")), + RequestUri = new System.Uri(reqMessage.StringProperty("RequestUri")), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(reqMessage.StringProperty("Content"), isBase64Request)) + }; + + foreach (var each in reqMessage.Property("Headers")) + { + response.RequestMessage.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + foreach (var each in reqMessage.Property("ContentHeaders")) + { + response.RequestMessage.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + return response; + } + + public async Task SendAsync(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + counter++; + var rqkey = $"{Description}+{Context}+{Scenario}+${request.Method.Method}+{request.RequestUri}+{counter}"; + + switch (Mode) + { + case MockMode.Record: + //Add following code since the request.Content will be released after sendAsync + var requestClone = request; + if (requestClone.Content != null) + { + requestClone = await request.CloneWithContent(request.RequestUri, request.Method); + } + // make the call + var response = await next.SendAsync(request, callback); + + // save the message to the recording file + SaveMessage(rqkey, requestClone, response); + + // return the response. + return response; + + case MockMode.Playback: + // load and return the response. + return LoadMessage(rqkey); + + default: + // pass-thru, do nothing + return await next.SendAsync(request, callback); + } + } + } +} diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Response.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Response.cs new file mode 100644 index 000000000000..a9d5f321063f --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Response.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + using System; + using System.Threading.Tasks; + public class Response : EventData + { + public Response() : base() + { + } + } + + public class Response : Response + { + private Func> _resultDelegate; + private Task _resultValue; + + public Response(T value) : base() => _resultValue = Task.FromResult(value); + public Response(Func value) : base() => _resultDelegate = () => Task.FromResult(value()); + public Response(Func> value) : base() => _resultDelegate = value; + public Task Result => _resultValue ?? (_resultValue = this._resultDelegate()); + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..502e98ad4add --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Serialization/JsonSerializer.cs @@ -0,0 +1,350 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal class JsonSerializer + { + private int depth = 0; + + private SerializationOptions options = new SerializationOptions(); + + #region Deserialization + + internal T Deseralize(JsonObject json) + where T : new() + { + var contract = JsonModelCache.Get(typeof(T)); + + return (T)DeserializeObject(contract, json); + } + + internal object DeserializeObject(JsonModel contract, JsonObject json) + { + var instance = Activator.CreateInstance(contract.Type); + + depth++; + + // Ensure we don't recurse forever + if (depth > 5) throw new Exception("Depth greater than 5"); + + foreach (var field in json) + { + var member = contract[field.Key]; + + if (member != null) + { + var value = DeserializeValue(member, field.Value); + + member.SetValue(instance, value); + } + } + + depth--; + + return instance; + } + + private object DeserializeValue(JsonMember member, JsonNode value) + { + if (value.Type == JsonType.Null) return null; + + var type = member.Type; + + if (member.IsStringLike && value.Type != JsonType.String) + { + // Take the long path... + return DeserializeObject(JsonModelCache.Get(type), (JsonObject)value); + } + else if (member.Converter != null) + { + return member.Converter.FromJson(value); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (member.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + private object DeserializeValue(Type type, JsonNode value) + { + if (type == null) throw new ArgumentNullException(nameof(type)); + + if (value.Type == JsonType.Null) return null; + + var typeDetails = TypeDetails.Get(type); + + if (typeDetails.JsonConverter != null) + { + return typeDetails.JsonConverter.FromJson(value); + } + else if (typeDetails.IsEnum) + { + return Enum.Parse(type, value.ToString(), ignoreCase: true); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (typeDetails.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + internal Array DeserializeArray(Type type, JsonArray elements) + { + var elementType = type.GetElementType(); + + var elementTypeDetails = TypeDetails.Get(elementType); + + var array = Array.CreateInstance(elementType, elements.Count); + + int i = 0; + + if (elementTypeDetails.JsonConverter != null) + { + foreach (var value in elements) + { + array.SetValue(elementTypeDetails.JsonConverter.FromJson(value), i); + + i++; + } + } + else + { + foreach (var value in elements) + { + array.SetValue(DeserializeValue(elementType, value), i); + + i++; + } + } + + return array; + } + + internal IList DeserializeList(Type type, JsonArray jsonArray) + { + // TODO: Handle non-generic types + if (!type.IsGenericType) + throw new ArgumentException("Must be a generic type", nameof(type)); + + var elementType = type.GetGenericArguments()[0]; + + IList list; + + if (type.IsInterface) + { + // Create a concrete generic list + list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(elementType)); + } + else + { + list = (IList)Activator.CreateInstance(type); + } + + foreach (var value in jsonArray) + { + list.Add(DeserializeValue(elementType, value)); + } + + return list; + } + + #endregion + + #region Serialization + + internal JsonNode Serialize(object instance) => + Serialize(instance, SerializationOptions.Default); + + internal JsonNode Serialize(object instance, string[] include) => + Serialize(instance, new SerializationOptions { Include = include }); + + internal JsonNode Serialize(object instance, SerializationOptions options) + { + this.options = options; + + if (instance == null) + { + return XNull.Instance; + } + + return ReadValue(instance.GetType(), instance); + } + + #region Readers + + internal JsonArray ReadArray(IEnumerable collection) + { + var array = new XNodeArray(); + + foreach (var item in collection) + { + array.Add(ReadValue(item.GetType(), item)); + } + + return array; + } + + internal IEnumerable> ReadProperties(object instance) + { + var contract = JsonModelCache.Get(instance.GetType()); + + foreach (var member in contract.Members) + { + string name = member.Name; + + if (options.PropertyNameTransformer != null) + { + name = options.PropertyNameTransformer.Invoke(name); + } + + // Skip the field if it's not included + if ((depth == 1 && !options.IsIncluded(name))) + { + continue; + } + + var value = member.GetValue(instance); + + if (!member.EmitDefaultValue && (value == null || (member.IsList && ((IList)value).Count == 0) || value.Equals(member.DefaultValue))) + { + continue; + } + else if (options.IgnoreNullValues && value == null) // Ignore null values + { + continue; + } + + // Transform the value if there is one + if (options.Transformations != null) + { + var transform = options.GetTransformation(name); + + if (transform != null) + { + value = transform.Transformer(value); + } + } + + yield return new KeyValuePair(name, ReadValue(member.TypeDetails, value)); + } + } + + private JsonObject ReadObject(object instance) + { + depth++; + + // TODO: Guard against a self referencing graph + if (depth > options.MaxDepth) + { + depth--; + + return new JsonObject(); + } + + var node = new JsonObject(ReadProperties(instance)); + + depth--; + + return node; + } + + private JsonNode ReadValue(Type type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + var member = TypeDetails.Get(type); + + return ReadValue(member, value); + } + + private JsonNode ReadValue(TypeDetails type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + if (type.JsonConverter != null) + { + return type.JsonConverter.ToJson(value); + } + else if (type.IsArray) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateArray((string[])value); + case TypeCode.UInt16: return CreateArray((ushort[])value); + case TypeCode.UInt32: return CreateArray((uint[])value); + case TypeCode.UInt64: return CreateArray((ulong[])value); + case TypeCode.Int16: return CreateArray((short[])value); + case TypeCode.Int32: return CreateArray((int[])value); + case TypeCode.Int64: return CreateArray((long[])value); + case TypeCode.Single: return CreateArray((float[])value); + case TypeCode.Double: return CreateArray((double[])value); + default: return ReadArray((IEnumerable)value); + } + } + else if (value is IEnumerable) + { + if (type.IsList && type.ElementType != null) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateList(value); + case TypeCode.UInt16: return CreateList(value); + case TypeCode.UInt32: return CreateList(value); + case TypeCode.UInt64: return CreateList(value); + case TypeCode.Int16: return CreateList(value); + case TypeCode.Int32: return CreateList(value); + case TypeCode.Int64: return CreateList(value); + case TypeCode.Single: return CreateList(value); + case TypeCode.Double: return CreateList(value); + } + } + + return ReadArray((IEnumerable)value); + } + else + { + // Complex object + return ReadObject(value); + } + } + + private XList CreateList(object value) => new XList((IList)value); + + private XImmutableArray CreateArray(T[] array) => new XImmutableArray(array); + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..1b88c1bcc2fa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Serialization/PropertyTransformation.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal class PropertyTransformation + { + internal PropertyTransformation(string name, Func transformer) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Transformer = transformer ?? throw new ArgumentNullException(nameof(transformer)); + } + + internal string Name { get; } + + internal Func Transformer { get; } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..015b0bfc62aa --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Serialization/SerializationOptions.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal class SerializationOptions + { + internal static readonly SerializationOptions Default = new SerializationOptions(); + + internal SerializationOptions() { } + + internal SerializationOptions( + string[] include = null, + bool ingoreNullValues = false) + { + Include = include; + IgnoreNullValues = ingoreNullValues; + } + + internal string[] Include { get; set; } + + internal string[] Exclude { get; set; } + + internal bool IgnoreNullValues { get; set; } + + internal PropertyTransformation[] Transformations { get; set; } + + internal Func PropertyNameTransformer { get; set; } + + internal int MaxDepth { get; set; } = 5; + + internal bool IsIncluded(string name) + { + if (Exclude != null) + { + return !Exclude.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + else if (Include != null) + { + return Include.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + + return true; + } + + internal PropertyTransformation GetTransformation(string propertyName) + { + if (Transformations == null) return null; + + foreach (var t in Transformations) + { + if (t.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) + { + return t; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/SerializationMode.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..5487daca5105 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/SerializationMode.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + [System.Flags] + public enum SerializationMode + { + None = 0, + IncludeHeaders = 1 << 0, + IncludeReadOnly = 1 << 1, + + IncludeAll = IncludeHeaders | IncludeReadOnly + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/UndeclaredResponseException.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..5d864d6018cf --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/UndeclaredResponseException.cs @@ -0,0 +1,112 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions; + + public class RestException : Exception, IDisposable + { + public System.Net.HttpStatusCode StatusCode { get; set; } + public string Code { get; protected set; } + protected string message; + public HttpRequestMessage RequestMessage { get; protected set; } + public HttpResponseHeaders ResponseHeaders { get; protected set; } + + public string ResponseBody { get; protected set; } + public string ClientRequestId { get; protected set; } + public string RequestId { get; protected set; } + + public override string Message => message; + public string Action { get; protected set; } + + public RestException(System.Net.Http.HttpResponseMessage response) + { + StatusCode = response.StatusCode; + //CloneWithContent will not work here since the content is disposed after sendAsync + //Besides, it seems there is no need for the request content cloned here. + RequestMessage = response.RequestMessage.Clone(); + ResponseBody = response.Content.ReadAsStringAsync().Result; + ResponseHeaders = response.Headers; + + RequestId = response.GetFirstHeader("x-ms-request-id"); + ClientRequestId = response.GetFirstHeader("x-ms-client-request-id"); + + try + { + // try to parse the body as JSON, and see if a code and message are in there. + var json = Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode.Parse(ResponseBody) as Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject; + + // error message could be in properties.statusMessage + { message = If(json?.Property("properties"), out var p) + && If(p?.PropertyT("statusMessage"), out var sm) + ? (string)sm : (string)Message; } + + // see if there is an error block in the body + json = json?.Property("error") ?? json; + + { Code = If(json?.PropertyT("code"), out var c) ? (string)c : (string)StatusCode.ToString(); } + { message = If(json?.PropertyT("message"), out var m) ? (string)m : (string)Message; } + { Action = If(json?.PropertyT("action"), out var a) ? (string)a : (string)Action; } + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // couldn't get the code/message from the body response. + // In this case, we will assume the response is the expected error message + if(!string.IsNullOrEmpty(ResponseBody)) { + message = ResponseBody; + } + } +#endif + if (string.IsNullOrEmpty(message)) + { + if (StatusCode >= System.Net.HttpStatusCode.BadRequest && StatusCode < System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Request Error, Status: {StatusCode}"; + } + else if (StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Server Error, Status: {StatusCode}"; + } + else + { + message = $"The server responded with an unrecognized response, Status: {StatusCode}"; + } + } + } + + public void Dispose() + { + ((IDisposable)RequestMessage).Dispose(); + } + } + + public class RestException : RestException + { + public T Error { get; protected set; } + public RestException(System.Net.Http.HttpResponseMessage response, T error) : base(response) + { + Error = error; + } + } + + + public class UndeclaredResponseException : RestException + { + public UndeclaredResponseException(System.Net.Http.HttpResponseMessage response) : base(response) + { + + } + } +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/Writers/JsonWriter.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..d0f185d521f4 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/Writers/JsonWriter.cs @@ -0,0 +1,223 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Web; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json +{ + internal class JsonWriter + { + const string indentation = " "; // 2 spaces + + private readonly bool pretty; + private readonly TextWriter writer; + + protected int currentLevel = 0; + + internal JsonWriter(TextWriter writer, bool pretty = true) + { + this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); + this.pretty = pretty; + } + + internal void WriteNode(JsonNode node) + { + switch (node.Type) + { + case JsonType.Array: WriteArray((IEnumerable)node); break; + case JsonType.Object: WriteObject((JsonObject)node); break; + + // Primitives + case JsonType.Binary: WriteBinary((XBinary)node); break; + case JsonType.Boolean: WriteBoolean((bool)node); break; + case JsonType.Date: WriteDate((JsonDate)node); break; + case JsonType.Null: WriteNull(); break; + case JsonType.Number: WriteNumber((JsonNumber)node); break; + case JsonType.String: WriteString(node); break; + } + } + + internal void WriteArray(IEnumerable array) + { + currentLevel++; + + writer.Write('['); + + bool doIndentation = false; + + if (pretty) + { + foreach (var node in array) + { + if (node.Type == JsonType.Object || node.Type == JsonType.Array) + { + doIndentation = true; + + break; + } + } + } + + bool isFirst = true; + + foreach (JsonNode node in array) + { + if (!isFirst) writer.Write(','); + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + WriteNode(node); + + isFirst = false; + } + + currentLevel--; + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + writer.Write(']'); + } + + internal void WriteIndent() + { + if (pretty) + { + writer.Write(Environment.NewLine); + + for (int level = 0; level < currentLevel; level++) + { + writer.Write(indentation); + } + } + } + + internal void WriteObject(JsonObject obj) + { + currentLevel++; + + writer.Write('{'); + + bool isFirst = true; + + foreach (var field in obj) + { + if (!isFirst) writer.Write(','); + + WriteIndent(); + + WriteFieldName(field.Key); + + writer.Write(':'); + + if (pretty) + { + writer.Write(' '); + } + + // Write the field value + WriteNode(field.Value); + + isFirst = false; + } + + currentLevel--; + + WriteIndent(); + + writer.Write('}'); + } + + internal void WriteFieldName(string fieldName) + { + writer.Write('"'); + writer.Write(HttpUtility.JavaScriptStringEncode(fieldName)); + writer.Write('"'); + } + + #region Primitives + + internal void WriteBinary(XBinary value) + { + writer.Write('"'); + writer.Write(value.ToString()); + writer.Write('"'); + } + + internal void WriteBoolean(bool value) + { + writer.Write(value ? "true" : "false"); + } + + internal void WriteDate(JsonDate date) + { + if (date.ToDateTime().Year == 1) + { + WriteNull(); + } + else + { + writer.Write('"'); + writer.Write(date.ToIsoString()); + writer.Write('"'); + } + } + + internal void WriteNull() + { + writer.Write("null"); + } + + internal void WriteNumber(JsonNumber number) + { + if (number.Overflows) + { + writer.Write('"'); + writer.Write(number.Value); + writer.Write('"'); + } + else + { + writer.Write(number.Value); + } + } + + internal void WriteString(string text) + { + if (text == null) + { + WriteNull(); + } + else + { + writer.Write('"'); + + writer.Write(HttpUtility.JavaScriptStringEncode(text)); + + writer.Write('"'); + } + } + + #endregion + } +} + + +// TODO: Replace with System.Text.Json when available diff --git a/swaggerci/apimanagement.DefaultTag/generated/runtime/delegates.cs b/swaggerci/apimanagement.DefaultTag/generated/runtime/delegates.cs new file mode 100644 index 000000000000..8af78b082f94 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/generated/runtime/delegates.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData=System.Func; + + public delegate Task SendAsync(HttpRequestMessage request, IEventListener callback); + public delegate Task SendAsyncStep(HttpRequestMessage request, IEventListener callback, ISendAsync next); + public delegate Task SignalEvent(string id, CancellationToken token, GetEventData getEventData); + public delegate Task Event(EventData message); + public delegate void SynchEvent(EventData message); + public delegate Task OnResponse(Response message); + public delegate Task OnResponse(Response message); +} \ No newline at end of file diff --git a/swaggerci/apimanagement.DefaultTag/readme.md b/swaggerci/apimanagement.DefaultTag/readme.md new file mode 100644 index 000000000000..24a0f33758b2 --- /dev/null +++ b/swaggerci/apimanagement.DefaultTag/readme.md @@ -0,0 +1,10 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../tools/SwaggerCI/readme.azure.noprofile.md + - $(this-folder)/../../../azure-rest-api-specs/specification/apimanagement/resource-manager/readme.md +try-require: + - $(this-folder)/../../../azure-rest-api-specs/specification/apimanagement/resource-manager/readme.powershell.md +```